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

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

Issue 1918623002: Use the MediaCodec flush workaround in more cases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_BASE_ANDROID_NDK_MEDIA_CODEC_BRIDGE_H_ 5 #ifndef MEDIA_BASE_ANDROID_NDK_MEDIA_CODEC_BRIDGE_H_
6 #define MEDIA_BASE_ANDROID_NDK_MEDIA_CODEC_BRIDGE_H_ 6 #define MEDIA_BASE_ANDROID_NDK_MEDIA_CODEC_BRIDGE_H_
7 7
8 #include <media/NdkMediaCodec.h> 8 #include <media/NdkMediaCodec.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 bool* end_of_stream, 54 bool* end_of_stream,
55 bool* key_frame) override; 55 bool* key_frame) override;
56 void ReleaseOutputBuffer(int index, bool render) override; 56 void ReleaseOutputBuffer(int index, bool render) override;
57 MediaCodecStatus GetInputBuffer(int input_buffer_index, 57 MediaCodecStatus GetInputBuffer(int input_buffer_index,
58 uint8_t** data, 58 uint8_t** data,
59 size_t* capacity) override; 59 size_t* capacity) override;
60 MediaCodecStatus CopyFromOutputBuffer(int index, 60 MediaCodecStatus CopyFromOutputBuffer(int index,
61 size_t offset, 61 size_t offset,
62 void* dst, 62 void* dst,
63 size_t num) override; 63 size_t num) override;
64 std::string GetName() override;
64 65
65 protected: 66 protected:
66 NdkMediaCodecBridge(const std::string& mime, 67 NdkMediaCodecBridge(const std::string& mime,
67 bool is_secure, 68 bool is_secure,
68 MediaCodecDirection direction); 69 MediaCodecDirection direction);
69 70
70 private: 71 private:
71 struct AMediaCodecDeleter { 72 struct AMediaCodecDeleter {
72 inline void operator()(AMediaCodec* ptr) const { AMediaCodec_delete(ptr); } 73 inline void operator()(AMediaCodec* ptr) const { AMediaCodec_delete(ptr); }
73 }; 74 };
74 75
76 // The direction used to create |media_codec_|.
77 MediaCodecDirection direction_;
78
79 // The mime used to create |media_codec_|.
80 std::string mime;
81
75 scoped_ptr<AMediaCodec, AMediaCodecDeleter> media_codec_; 82 scoped_ptr<AMediaCodec, AMediaCodecDeleter> media_codec_;
76 83
77 DISALLOW_COPY_AND_ASSIGN(NdkMediaCodecBridge); 84 DISALLOW_COPY_AND_ASSIGN(NdkMediaCodecBridge);
78 }; 85 };
79 86
80 } // namespace media 87 } // namespace media
81 88
82 #endif // MEDIA_BASE_ANDROID_NDK_MEDIA_CODEC_BRIDGE_H_ 89 #endif // MEDIA_BASE_ANDROID_NDK_MEDIA_CODEC_BRIDGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698