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

Side by Side Diff: media/filters/ffmpeg_video_decoder.h

Issue 10451051: Provide a Chrome-owned buffer to FFmpeg for video decoding, instead of (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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
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 MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ 5 #ifndef MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_
6 #define MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ 6 #define MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_
7 7
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 16 matching lines...) Expand all
27 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, 27 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream,
28 const PipelineStatusCB& status_cb, 28 const PipelineStatusCB& status_cb,
29 const StatisticsCB& statistics_cb) OVERRIDE; 29 const StatisticsCB& statistics_cb) OVERRIDE;
30 virtual void Read(const ReadCB& read_cb) OVERRIDE; 30 virtual void Read(const ReadCB& read_cb) OVERRIDE;
31 virtual void Reset(const base::Closure& closure) OVERRIDE; 31 virtual void Reset(const base::Closure& closure) OVERRIDE;
32 virtual void Stop(const base::Closure& closure) OVERRIDE; 32 virtual void Stop(const base::Closure& closure) OVERRIDE;
33 virtual const gfx::Size& natural_size() OVERRIDE; 33 virtual const gfx::Size& natural_size() OVERRIDE;
34 34
35 AesDecryptor* decryptor(); 35 AesDecryptor* decryptor();
36 36
37 // called from within ffmpeg
Ami GONE FROM CHROMIUM 2012/05/26 22:52:34 Comments need to be complete English sentences, st
38 int GetVideoBuffer(AVFrame *frame);
39
37 protected: 40 protected:
38 virtual ~FFmpegVideoDecoder(); 41 virtual ~FFmpegVideoDecoder();
39 42
40 private: 43 private:
41 enum DecoderState { 44 enum DecoderState {
42 kUninitialized, 45 kUninitialized,
43 kNormal, 46 kNormal,
44 kFlushCodec, 47 kFlushCodec,
45 kDecodeFinished, 48 kDecodeFinished,
46 }; 49 };
47 50
48 // Carries out the reading operation scheduled by Read(). 51 // Carries out the reading operation scheduled by Read().
49 void DoRead(const ReadCB& read_cb); 52 void DoRead(const ReadCB& read_cb);
50 53
51 // Reads from the demuxer stream with corresponding callback method. 54 // Reads from the demuxer stream with corresponding callback method.
52 void ReadFromDemuxerStream(); 55 void ReadFromDemuxerStream();
53 void DecodeBuffer(const scoped_refptr<Buffer>& buffer); 56 void DecodeBuffer(const scoped_refptr<Buffer>& buffer);
54 57
55 // Carries out the decoding operation scheduled by DecodeBuffer(). 58 // Carries out the decoding operation scheduled by DecodeBuffer().
56 void DoDecodeBuffer(const scoped_refptr<Buffer>& buffer); 59 void DoDecodeBuffer(const scoped_refptr<Buffer>& buffer);
60 int AllocBuffer(VideoFrame **ptr);
57 bool Decode(const scoped_refptr<Buffer>& buffer, 61 bool Decode(const scoped_refptr<Buffer>& buffer,
58 scoped_refptr<VideoFrame>* video_frame); 62 scoped_refptr<VideoFrame>* video_frame);
59 63
60 // Delivers the frame to |read_cb_| and resets the callback. 64 // Delivers the frame to |read_cb_| and resets the callback.
61 void DeliverFrame(const scoped_refptr<VideoFrame>& video_frame); 65 void DeliverFrame(const scoped_refptr<VideoFrame>& video_frame);
62 66
63 // Releases resources associated with |codec_context_| and |av_frame_| 67 // Releases resources associated with |codec_context_| and |av_frame_|
64 // and resets them to NULL. 68 // and resets them to NULL.
65 void ReleaseFFmpegResources(); 69 void ReleaseFFmpegResources();
66 70
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 scoped_refptr<DemuxerStream> demuxer_stream_; 103 scoped_refptr<DemuxerStream> demuxer_stream_;
100 104
101 AesDecryptor decryptor_; 105 AesDecryptor decryptor_;
102 106
103 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); 107 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder);
104 }; 108 };
105 109
106 } // namespace media 110 } // namespace media
107 111
108 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ 112 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698