OLD | NEW |
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" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "media/base/demuxer_stream.h" |
12 #include "media/base/video_decoder.h" | 13 #include "media/base/video_decoder.h" |
13 | 14 |
14 class MessageLoop; | 15 class MessageLoop; |
15 | 16 |
16 struct AVCodecContext; | 17 struct AVCodecContext; |
17 struct AVFrame; | 18 struct AVFrame; |
18 | 19 |
19 namespace media { | 20 namespace media { |
20 | 21 |
21 class DecoderBuffer; | 22 class DecoderBuffer; |
(...skipping 30 matching lines...) Expand all Loading... |
52 kNormal, | 53 kNormal, |
53 kFlushCodec, | 54 kFlushCodec, |
54 kDecodeFinished, | 55 kDecodeFinished, |
55 }; | 56 }; |
56 | 57 |
57 // Carries out the reading operation scheduled by Read(). | 58 // Carries out the reading operation scheduled by Read(). |
58 void DoRead(const ReadCB& read_cb); | 59 void DoRead(const ReadCB& read_cb); |
59 | 60 |
60 // Reads from the demuxer stream with corresponding callback method. | 61 // Reads from the demuxer stream with corresponding callback method. |
61 void ReadFromDemuxerStream(); | 62 void ReadFromDemuxerStream(); |
62 void DecodeBuffer(const scoped_refptr<DecoderBuffer>& buffer); | 63 void DecodeBuffer(DemuxerStream::Status status, |
| 64 const scoped_refptr<DecoderBuffer>& buffer); |
63 | 65 |
64 // Carries out the decoding operation scheduled by DecodeBuffer(). | 66 // Carries out the decoding operation scheduled by DecodeBuffer(). |
65 void DoDecodeBuffer(const scoped_refptr<DecoderBuffer>& buffer); | 67 void DoDecodeBuffer(DemuxerStream::Status status, |
| 68 const scoped_refptr<DecoderBuffer>& buffer); |
66 bool Decode(const scoped_refptr<DecoderBuffer>& buffer, | 69 bool Decode(const scoped_refptr<DecoderBuffer>& buffer, |
67 scoped_refptr<VideoFrame>* video_frame); | 70 scoped_refptr<VideoFrame>* video_frame); |
68 | 71 |
69 // Delivers the frame to |read_cb_| and resets the callback. | 72 // Delivers the frame to |read_cb_| and resets the callback. |
70 void DeliverFrame(const scoped_refptr<VideoFrame>& video_frame); | 73 void DeliverFrame(const scoped_refptr<VideoFrame>& video_frame); |
71 | 74 |
72 // Releases resources associated with |codec_context_| and |av_frame_| | 75 // Releases resources associated with |codec_context_| and |av_frame_| |
73 // and resets them to NULL. | 76 // and resets them to NULL. |
74 void ReleaseFFmpegResources(); | 77 void ReleaseFFmpegResources(); |
75 | 78 |
(...skipping 28 matching lines...) Expand all Loading... |
104 scoped_refptr<DemuxerStream> demuxer_stream_; | 107 scoped_refptr<DemuxerStream> demuxer_stream_; |
105 | 108 |
106 Decryptor* decryptor_; | 109 Decryptor* decryptor_; |
107 | 110 |
108 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); | 111 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); |
109 }; | 112 }; |
110 | 113 |
111 } // namespace media | 114 } // namespace media |
112 | 115 |
113 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ | 116 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ |
OLD | NEW |