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

Side by Side Diff: webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.h

Issue 11929015: Tighten up media::DecoderBuffer API contract for end of stream buffers (round 2). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 WEBKIT_MEDIA_CRYPTO_PPAPI_FFMPEG_CDM_AUDIO_DECODER_H_ 5 #ifndef WEBKIT_MEDIA_CRYPTO_PPAPI_FFMPEG_CDM_AUDIO_DECODER_H_
6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_FFMPEG_CDM_AUDIO_DECODER_H_ 6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_FFMPEG_CDM_AUDIO_DECODER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 24 matching lines...) Expand all
35 void Deinitialize(); 35 void Deinitialize();
36 void Reset(); 36 void Reset();
37 37
38 // Returns true when |config| is a valid audio decoder configuration. 38 // Returns true when |config| is a valid audio decoder configuration.
39 static bool IsValidConfig(const cdm::AudioDecoderConfig& config); 39 static bool IsValidConfig(const cdm::AudioDecoderConfig& config);
40 40
41 // Decodes |compressed_buffer|. Returns |cdm::kSuccess| after storing 41 // Decodes |compressed_buffer|. Returns |cdm::kSuccess| after storing
42 // output in |decoded_frames| when output is available. Returns 42 // output in |decoded_frames| when output is available. Returns
43 // |cdm::kNeedMoreData| when |compressed_frame| does not produce output. 43 // |cdm::kNeedMoreData| when |compressed_frame| does not produce output.
44 // Returns |cdm::kDecodeError| when decoding fails. 44 // Returns |cdm::kDecodeError| when decoding fails.
45 //
46 // A null |compressed_buffer| will attempt to flush the decoder of any
47 // remaining frames. |compressed_buffer_size| and |timestamp| are ignored.
45 cdm::Status DecodeBuffer(const uint8_t* compressed_buffer, 48 cdm::Status DecodeBuffer(const uint8_t* compressed_buffer,
46 int32_t compressed_buffer_size, 49 int32_t compressed_buffer_size,
47 int64_t timestamp, 50 int64_t timestamp,
48 cdm::AudioFrames* decoded_frames); 51 cdm::AudioFrames* decoded_frames);
49 52
50 private: 53 private:
51 void ResetTimestampState(); 54 void ResetTimestampState();
52 void ReleaseFFmpegResources(); 55 void ReleaseFFmpegResources();
53 56
54 base::TimeDelta GetNextOutputTimestamp() const; 57 base::TimeDelta GetNextOutputTimestamp() const;
(...skipping 28 matching lines...) Expand all
83 86
84 typedef std::vector<uint8_t> SerializedAudioFrames; 87 typedef std::vector<uint8_t> SerializedAudioFrames;
85 SerializedAudioFrames serialized_audio_frames_; 88 SerializedAudioFrames serialized_audio_frames_;
86 89
87 DISALLOW_COPY_AND_ASSIGN(FFmpegCdmAudioDecoder); 90 DISALLOW_COPY_AND_ASSIGN(FFmpegCdmAudioDecoder);
88 }; 91 };
89 92
90 } // namespace webkit_media 93 } // namespace webkit_media
91 94
92 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_FFMPEG_CDM_AUDIO_DECODER_H_ 95 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_FFMPEG_CDM_AUDIO_DECODER_H_
OLDNEW
« no previous file with comments | « webkit/media/crypto/ppapi/clear_key_cdm.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