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

Side by Side Diff: media/ffmpeg/ffmpeg_common.cc

Issue 10910293: Add is_encrypted() in VideoDecoderConfig. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move is_encrypted into VideoDecoderConfig. Created 8 years, 3 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 #include "media/ffmpeg/ffmpeg_common.h" 5 #include "media/ffmpeg/ffmpeg_common.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "media/base/video_util.h" 8 #include "media/base/video_util.h"
9 9
10 namespace media { 10 namespace media {
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 262
263 VideoCodec codec = CodecIDToVideoCodec(stream->codec->codec_id); 263 VideoCodec codec = CodecIDToVideoCodec(stream->codec->codec_id);
264 VideoCodecProfile profile = (codec == kCodecVP8) ? VP8PROFILE_MAIN : 264 VideoCodecProfile profile = (codec == kCodecVP8) ? VP8PROFILE_MAIN :
265 ProfileIDToVideoCodecProfile(stream->codec->profile); 265 ProfileIDToVideoCodecProfile(stream->codec->profile);
266 gfx::Size natural_size = GetNaturalSize( 266 gfx::Size natural_size = GetNaturalSize(
267 visible_rect.size(), aspect_ratio.num, aspect_ratio.den); 267 visible_rect.size(), aspect_ratio.num, aspect_ratio.den);
268 config->Initialize(codec, 268 config->Initialize(codec,
269 profile, 269 profile,
270 PixelFormatToVideoFormat(stream->codec->pix_fmt), 270 PixelFormatToVideoFormat(stream->codec->pix_fmt),
271 coded_size, visible_rect, natural_size, 271 coded_size, visible_rect, natural_size,
272 stream->codec->extradata, 272 stream->codec->extradata, stream->codec->extradata_size,
273 stream->codec->extradata_size, 273 false,
274 true); 274 true);
275 } 275 }
276 276
277 void VideoDecoderConfigToAVCodecContext( 277 void VideoDecoderConfigToAVCodecContext(
278 const VideoDecoderConfig& config, 278 const VideoDecoderConfig& config,
279 AVCodecContext* codec_context) { 279 AVCodecContext* codec_context) {
280 codec_context->codec_type = AVMEDIA_TYPE_VIDEO; 280 codec_context->codec_type = AVMEDIA_TYPE_VIDEO;
281 codec_context->codec_id = VideoCodecToCodecID(config.codec()); 281 codec_context->codec_id = VideoCodecToCodecID(config.codec());
282 codec_context->profile = VideoCodecProfileToProfileID(config.profile()); 282 codec_context->profile = VideoCodecProfileToProfileID(config.profile());
283 codec_context->coded_width = config.coded_size().width(); 283 codec_context->coded_width = config.coded_size().width();
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 avcodec_close(stream->codec); 387 avcodec_close(stream->codec);
388 } 388 }
389 } 389 }
390 } 390 }
391 391
392 // Then finally cleanup the format context. 392 // Then finally cleanup the format context.
393 avformat_close_input(&format_context); 393 avformat_close_input(&format_context);
394 } 394 }
395 395
396 } // namespace media 396 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698