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

Side by Side Diff: media/cdm/ppapi/external_clear_key/ffmpeg_cdm_video_decoder.h

Issue 197793005: Convert scoped_ptr_malloc -> scoped_ptr, part 5. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_CDM_PPAPI_EXTERNAL_CLEAR_KEY_FFMPEG_CDM_VIDEO_DECODER_H_ 5 #ifndef MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_FFMPEG_CDM_VIDEO_DECODER_H_
6 #define MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_FFMPEG_CDM_VIDEO_DECODER_H_ 6 #define MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_FFMPEG_CDM_VIDEO_DECODER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "media/cdm/ppapi/external_clear_key/cdm_video_decoder.h" 11 #include "media/cdm/ppapi/external_clear_key/cdm_video_decoder.h"
12 #include "media/cdm/ppapi/external_clear_key/clear_key_cdm_common.h" 12 #include "media/cdm/ppapi/external_clear_key/clear_key_cdm_common.h"
13 #include "media/ffmpeg/ffmpeg_deleters.h"
13 14
14 struct AVCodecContext; 15 struct AVCodecContext;
15 struct AVFrame; 16 struct AVFrame;
16 17
17 namespace media { 18 namespace media {
18 19
19 class ScopedPtrAVFreeContext;
20 class ScopedPtrAVFreeFrame;
21
22 class FFmpegCdmVideoDecoder : public CdmVideoDecoder { 20 class FFmpegCdmVideoDecoder : public CdmVideoDecoder {
23 public: 21 public:
24 explicit FFmpegCdmVideoDecoder(ClearKeyCdmHost* host); 22 explicit FFmpegCdmVideoDecoder(ClearKeyCdmHost* host);
25 virtual ~FFmpegCdmVideoDecoder(); 23 virtual ~FFmpegCdmVideoDecoder();
26 24
27 // CdmVideoDecoder implementation. 25 // CdmVideoDecoder implementation.
28 virtual bool Initialize(const cdm::VideoDecoderConfig& config) OVERRIDE; 26 virtual bool Initialize(const cdm::VideoDecoderConfig& config) OVERRIDE;
29 virtual void Deinitialize() OVERRIDE; 27 virtual void Deinitialize() OVERRIDE;
30 virtual void Reset() OVERRIDE; 28 virtual void Reset() OVERRIDE;
31 virtual cdm::Status DecodeFrame(const uint8_t* compressed_frame, 29 virtual cdm::Status DecodeFrame(const uint8_t* compressed_frame,
32 int32_t compressed_frame_size, 30 int32_t compressed_frame_size,
33 int64_t timestamp, 31 int64_t timestamp,
34 cdm::VideoFrame* decoded_frame) OVERRIDE; 32 cdm::VideoFrame* decoded_frame) OVERRIDE;
35 virtual bool is_initialized() const OVERRIDE { return is_initialized_; } 33 virtual bool is_initialized() const OVERRIDE { return is_initialized_; }
36 34
37 // Returns true when |format| and |data_size| specify a supported video 35 // Returns true when |format| and |data_size| specify a supported video
38 // output configuration. 36 // output configuration.
39 static bool IsValidOutputConfig(cdm::VideoFormat format, 37 static bool IsValidOutputConfig(cdm::VideoFormat format,
40 const cdm::Size& data_size); 38 const cdm::Size& data_size);
41 39
42 private: 40 private:
43 // Allocates storage, then copies video frame stored in |av_frame_| to 41 // Allocates storage, then copies video frame stored in |av_frame_| to
44 // |cdm_video_frame|. Returns true when allocation and copy succeed. 42 // |cdm_video_frame|. Returns true when allocation and copy succeed.
45 bool CopyAvFrameTo(cdm::VideoFrame* cdm_video_frame); 43 bool CopyAvFrameTo(cdm::VideoFrame* cdm_video_frame);
46 44
47 void ReleaseFFmpegResources(); 45 void ReleaseFFmpegResources();
48 46
49 // FFmpeg structures owned by this object. 47 // FFmpeg structures owned by this object.
50 scoped_ptr_malloc<AVCodecContext, ScopedPtrAVFreeContext> codec_context_; 48 scoped_ptr<AVCodecContext, ScopedPtrAVFreeContext> codec_context_;
51 scoped_ptr_malloc<AVFrame, ScopedPtrAVFreeFrame> av_frame_; 49 scoped_ptr<AVFrame, ScopedPtrAVFreeFrame> av_frame_;
52 50
53 bool is_initialized_; 51 bool is_initialized_;
54 52
55 ClearKeyCdmHost* const host_; 53 ClearKeyCdmHost* const host_;
56 54
57 DISALLOW_COPY_AND_ASSIGN(FFmpegCdmVideoDecoder); 55 DISALLOW_COPY_AND_ASSIGN(FFmpegCdmVideoDecoder);
58 }; 56 };
59 57
60 } // namespace media 58 } // namespace media
61 59
62 #endif // MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_FFMPEG_CDM_VIDEO_DECODER_H_ 60 #endif // MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_FFMPEG_CDM_VIDEO_DECODER_H_
OLDNEW
« no previous file with comments | « media/cdm/ppapi/external_clear_key/ffmpeg_cdm_audio_decoder.h ('k') | media/ffmpeg/ffmpeg_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698