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

Unified Diff: media/filters/android/media_codec_audio_decoder.h

Issue 1651673002: Add MediaCodecAudioDecoder implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modified a comment Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: media/filters/android/media_codec_audio_decoder.h
diff --git a/media/filters/android/media_codec_audio_decoder.h b/media/filters/android/media_codec_audio_decoder.h
index 1e307893a1534a617afb8b6a1489aa27795cc823..e012ef9e8e569c6d9f8c34f142232b8aaec77ac3 100644
--- a/media/filters/android/media_codec_audio_decoder.h
+++ b/media/filters/android/media_codec_audio_decoder.h
@@ -16,7 +16,6 @@
#include "media/base/android/media_codec_bridge.h"
#include "media/base/audio_decoder.h"
#include "media/base/audio_decoder_config.h"
-#include "media/base/media_export.h"
namespace base {
class SingleThreadTaskRunner;
@@ -53,10 +52,15 @@ namespace media {
// Because both dequeuing and enqueuing of an input buffer can fail, the
// implementation puts the input |DecoderBuffer|s and the corresponding decode
// callbacks into an input queue. The decoder has a timer that periodically
-// tries to send the front buffer from the input queue to the MediaCodec. In
-// the case of success the element is removed from the queue, the decode
-// callback is fired and the decoding process advances. The same timer tries to
-// dequeue an output buffer.
+// fires the decoding cycle that has two steps. The first step tries to send the
+// front buffer from the input queue to the MediaCodec. In the case of success
+// the element is removed from the queue, the decode callback is fired and the
+// decoding process advances. The second step tries to dequeue an output buffer,
+// and uses it in the case of success.
+//
+// The failures in both steps are normal and they happen periodically since
Tima Vaisburd 2016/02/11 20:23:23 This is where I tried to clarify the timer functio
xhwang 2016/02/12 10:15:06 Acknowledged.
+// both input and output buffers become available at unpredictable moments. The
+// timer is here to repeat the dequeueing attempts.
//
// Although one can specify a delay in the MediaCodec's dequeue operations,
// this implementation follows the simple logic which is similar to
@@ -94,7 +98,7 @@ namespace media {
// | | |
// [Error] [Ready] [Error]
-class MEDIA_EXPORT MediaCodecAudioDecoder : public AudioDecoder {
+class MediaCodecAudioDecoder : public AudioDecoder {
xhwang 2016/02/12 10:15:06 You'll need MEDIA_EXPORT when you add unittest. I
Tima Vaisburd 2016/02/13 01:31:24 Acknowledged.
public:
explicit MediaCodecAudioDecoder(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
@@ -154,17 +158,12 @@ class MEDIA_EXPORT MediaCodecAudioDecoder : public AudioDecoder {
// Helper method to change the state.
void SetState(State new_state);
- // The following helper methods ConfigureMediaCodec(), OnDecodedFrame(),
- // OnOutputFormatChanged() are specific to the stream (audio/video), but
- // others seem to apply to any MediaCodec decoder.
+ // The following helper methods OnDecodedFrame(),OnOutputFormatChanged() are
+ // specific to the stream (audio/video), but others seem to apply to any
+ // MediaCodec decoder.
// TODO(timav): refactor the common part out and use it here and in AVDA
// (http://crbug.com/583082).
- // Configures MediaCodec with |config|. Returns valid MediaCodec pointer if
- // succeeded or null if configuration failed.
- scoped_ptr<MediaCodecBridge> ConfigureMediaCodec(
- const AudioDecoderConfig& config);
-
// Processes the output buffer after it comes from MediaCodec.
void OnDecodedFrame(const OutputBufferInfo& out);

Powered by Google App Engine
This is Rietveld 408576698