Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: media/base/android/ndk_media_codec_bridge.h

Issue 1472943002: Refactor MediaCodecBridge to add support for NDK APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add media_codec_util.cc(h) Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_BASE_ANDROID_NDK_MEDIA_CODEC_BRIDGE_H_
6 #define MEDIA_BASE_ANDROID_NDK_MEDIA_CODEC_BRIDGE_H_
7
8 #include <media/NdkMediaCodec.h>
xhwang 2015/11/30 23:11:50 Add a ref link to the NDK doc (if it exists)?
qinmin 2015/12/03 22:46:24 NDK don't have a reference page.
9
10 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/time/time.h"
13 #include "media/base/android/media_codec_bridge.h"
14 #include "media/base/media_export.h"
15
16 namespace media {
17
18 class MEDIA_EXPORT NdkMediaCodecBridge : public MediaCodecBridge {
19 public:
20 ~NdkMediaCodecBridge() override;
21
xhwang 2015/11/30 23:11:50 // MediaCodecBridge implementation.
qinmin 2015/12/03 22:46:24 Done.
22 MediaCodecStatus Reset() override;
23 bool Start() override;
24 void Stop() override;
25 void GetOutputFormat(int* width, int* height) override;
26 int GetOutputSamplingRate() override;
27 MediaCodecStatus QueueInputBuffer(
28 int index,
29 const uint8* data,
30 size_t data_size,
31 const base::TimeDelta& presentation_time) override;
32 using MediaCodecBridge::QueueSecureInputBuffer;
33 MediaCodecStatus QueueSecureInputBuffer(
34 int index,
35 const uint8* data,
36 size_t data_size,
37 const uint8* key_id,
38 int key_id_size,
39 const uint8* iv,
40 int iv_size,
41 const SubsampleEntry* subsamples,
42 int subsamples_size,
43 const base::TimeDelta& presentation_time) override;
44 void QueueEOS(int input_buffer_index);
45 MediaCodecStatus DequeueInputBuffer(const base::TimeDelta& timeout,
46 int* index) override;
47 MediaCodecStatus DequeueOutputBuffer(const base::TimeDelta& timeout,
48 int* index,
49 size_t* offset,
50 size_t* size,
51 base::TimeDelta* presentation_time,
52 bool* end_of_stream,
53 bool* key_frame) override;
54 void ReleaseOutputBuffer(int index, bool render) override;
55 void GetInputBuffer(int input_buffer_index,
56 uint8** data,
57 size_t* capacity) override;
58 bool CopyFromOutputBuffer(int index,
59 size_t offset,
60 void* dst,
61 int dst_size) override;
62
63 protected:
64 NdkMediaCodecBridge(const std::string& mime,
65 bool is_secure,
66 MediaCodecDirection direction);
67
68 private:
69 struct AMediaCodecDeleter {
70 inline void operator()(AMediaCodec* ptr) const { AMediaCodec_delete(ptr); }
71 };
72
73 scoped_ptr<AMediaCodec, AMediaCodecDeleter> media_codec_;
74
75 DISALLOW_COPY_AND_ASSIGN(NdkMediaCodecBridge);
76 };
77
78 } // namespace media
79
80 #endif // MEDIA_BASE_ANDROID_NDK_MEDIA_CODEC_BRIDGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698