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

Unified Diff: webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.h

Issue 11778079: Encrypted Media: Enforcing the CDM to decode audio into S16 integers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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: webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.h
diff --git a/webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.h b/webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.h
index 51efb6b8185bb30215116d99c766030a66759a6a..994f0be16c87182f0c1d8a03475d94ed9b8133b5 100644
--- a/webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.h
+++ b/webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.h
@@ -8,6 +8,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
#include "base/time.h"
#include "base/compiler_specific.h"
#include "webkit/media/crypto/ppapi/cdm/content_decryption_module.h"
@@ -15,8 +16,17 @@
struct AVCodecContext;
struct AVFrame;
+namespace media {
+class AudioBus;
+class AudioTimestampHelper;
+}
+
namespace webkit_media {
+// TODO(xhwang): This class is partially cloned from media::FFmpegAudioDecoder.
+// When media::FFmpegAudioDecoder is updated, it's a pain to keep this class
+// in sync with media::FFmpegAudioDecoder. We need a long term sustainable
+// solution for this. See http://crbug.com/169203
class FFmpegCdmAudioDecoder {
public:
explicit FFmpegCdmAudioDecoder(cdm::Allocator* allocator);
@@ -38,7 +48,7 @@ class FFmpegCdmAudioDecoder {
cdm::AudioFrames* decoded_frames);
private:
- void ResetAudioTimingData();
+ void ResetTimestampState();
void ReleaseFFmpegResources();
base::TimeDelta GetNextOutputTimestamp() const;
@@ -58,11 +68,14 @@ class FFmpegCdmAudioDecoder {
int samples_per_second_;
// Used for computing output timestamps.
+ scoped_ptr<media::AudioTimestampHelper> output_timestamp_helper_;
int bytes_per_frame_;
- base::TimeDelta output_timestamp_base_;
- int64_t total_frames_decoded_;
base::TimeDelta last_input_timestamp_;
+ // We may need to convert the audio data coming out of FFmpeg from planar
+ // float to integer.
+ scoped_ptr<media::AudioBus> converter_bus_;
+
// Number of output sample bytes to drop before generating output buffers.
// This is required for handling negative timestamps when decoding Vorbis
// audio, for example.
« no previous file with comments | « media/filters/decrypting_audio_decoder_unittest.cc ('k') | webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698