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

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..e328ac2c470b999931c5b1908e4b6fb27bcbf8fe 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,6 +16,11 @@
struct AVCodecContext;
struct AVFrame;
+namespace media {
+class AudioBus;
+class AudioTimestampHelper;
+}
+
namespace webkit_media {
class FFmpegCdmAudioDecoder {
@@ -38,7 +44,7 @@ class FFmpegCdmAudioDecoder {
cdm::AudioFrames* decoded_frames);
private:
- void ResetAudioTimingData();
+ void ResetTimestampState();
void ReleaseFFmpegResources();
base::TimeDelta GetNextOutputTimestamp() const;
@@ -58,11 +64,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.

Powered by Google App Engine
This is Rietveld 408576698