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

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

Issue 10704175: Add config change support to FFmpegVideoDecoder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 // Carries out the decoding operation scheduled by DecodeBuffer(). 66 // Carries out the decoding operation scheduled by DecodeBuffer().
67 void DoDecodeBuffer(DemuxerStream::Status status, 67 void DoDecodeBuffer(DemuxerStream::Status status,
68 const scoped_refptr<DecoderBuffer>& buffer); 68 const scoped_refptr<DecoderBuffer>& buffer);
69 bool Decode(const scoped_refptr<DecoderBuffer>& buffer, 69 bool Decode(const scoped_refptr<DecoderBuffer>& buffer,
70 scoped_refptr<VideoFrame>* video_frame); 70 scoped_refptr<VideoFrame>* video_frame);
71 71
72 // Delivers the frame to |read_cb_| and resets the callback. 72 // Delivers the frame to |read_cb_| and resets the callback.
73 void DeliverFrame(const scoped_refptr<VideoFrame>& video_frame); 73 void DeliverFrame(const scoped_refptr<VideoFrame>& video_frame);
74 74
75 // Allocate resources for |codec_context_| and |av_frame_| based
76 // on the information in |config|.
77 bool AllocateFFmpegResources(const VideoDecoderConfig& config);
78
75 // Releases resources associated with |codec_context_| and |av_frame_| 79 // Releases resources associated with |codec_context_| and |av_frame_|
76 // and resets them to NULL. 80 // and resets them to NULL.
77 void ReleaseFFmpegResources(); 81 void ReleaseFFmpegResources();
78 82
79 // Reset decoder and call |reset_cb_|. 83 // Reset decoder and call |reset_cb_|.
80 void DoReset(); 84 void DoReset();
81 85
86 // Handles fetching a new config from the demuxer stream and
87 // reinitializing the decoder. Returns true if the config change
88 // was successful. Returns false if an error occured.
89 bool HandleConfigChange();
90
82 // This is !is_null() iff Initialize() hasn't been called. 91 // This is !is_null() iff Initialize() hasn't been called.
83 base::Callback<MessageLoop*()> message_loop_factory_cb_; 92 base::Callback<MessageLoop*()> message_loop_factory_cb_;
84 93
85 MessageLoop* message_loop_; 94 MessageLoop* message_loop_;
86 95
87 DecoderState state_; 96 DecoderState state_;
88 97
89 StatisticsCB statistics_cb_; 98 StatisticsCB statistics_cb_;
90 99
91 ReadCB read_cb_; 100 ReadCB read_cb_;
(...skipping 15 matching lines...) Expand all
107 scoped_refptr<DemuxerStream> demuxer_stream_; 116 scoped_refptr<DemuxerStream> demuxer_stream_;
108 117
109 Decryptor* decryptor_; 118 Decryptor* decryptor_;
110 119
111 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); 120 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder);
112 }; 121 };
113 122
114 } // namespace media 123 } // namespace media
115 124
116 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ 125 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698