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

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

Issue 2871263003: Set |config_| only after decoder has been successfully configured (Closed)
Patch Set: fixed unittests Created 3 years, 7 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
« no previous file with comments | « media/filters/ffmpeg_audio_decoder.cc ('k') | media/filters/ffmpeg_video_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <list> 8 #include <list>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 kDecodeFinished, 61 kDecodeFinished,
62 kError 62 kError
63 }; 63 };
64 64
65 // Handles decoding an unencrypted encoded buffer. 65 // Handles decoding an unencrypted encoded buffer.
66 bool FFmpegDecode(const scoped_refptr<DecoderBuffer>& buffer, 66 bool FFmpegDecode(const scoped_refptr<DecoderBuffer>& buffer,
67 bool* has_produced_frame); 67 bool* has_produced_frame);
68 68
69 // Handles (re-)initializing the decoder with a (new) config. 69 // Handles (re-)initializing the decoder with a (new) config.
70 // Returns true if initialization was successful. 70 // Returns true if initialization was successful.
71 bool ConfigureDecoder(bool low_delay); 71 bool ConfigureDecoder(const VideoDecoderConfig& config, bool low_delay);
72 72
73 // Releases resources associated with |codec_context_| and |av_frame_| 73 // Releases resources associated with |codec_context_| and |av_frame_|
74 // and resets them to NULL. 74 // and resets them to NULL.
75 void ReleaseFFmpegResources(); 75 void ReleaseFFmpegResources();
76 76
77 base::ThreadChecker thread_checker_; 77 base::ThreadChecker thread_checker_;
78 MediaLog* media_log_; 78 MediaLog* media_log_;
79 79
80 DecoderState state_; 80 DecoderState state_;
81 81
82 OutputCB output_cb_; 82 OutputCB output_cb_;
83 83
84 // FFmpeg structures owned by this object. 84 // FFmpeg structures owned by this object.
85 std::unique_ptr<AVCodecContext, ScopedPtrAVFreeContext> codec_context_; 85 std::unique_ptr<AVCodecContext, ScopedPtrAVFreeContext> codec_context_;
86 std::unique_ptr<AVFrame, ScopedPtrAVFreeFrame> av_frame_; 86 std::unique_ptr<AVFrame, ScopedPtrAVFreeFrame> av_frame_;
87 87
88 VideoDecoderConfig config_; 88 VideoDecoderConfig config_;
89 89
90 VideoFramePool frame_pool_; 90 VideoFramePool frame_pool_;
91 91
92 bool decode_nalus_; 92 bool decode_nalus_;
93 93
94 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); 94 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder);
95 }; 95 };
96 96
97 } // namespace media 97 } // namespace media
98 98
99 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ 99 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_
OLDNEW
« no previous file with comments | « media/filters/ffmpeg_audio_decoder.cc ('k') | media/filters/ffmpeg_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698