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

Side by Side Diff: services/media/framework_ffmpeg/ffmpeg_decoder.cc

Issue 1822333002: Motown: wholesale clang-format (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: dalesat Created 4 years, 9 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "services/media/framework_ffmpeg/av_codec_context.h" 5 #include "services/media/framework_ffmpeg/av_codec_context.h"
6 #include "services/media/framework_ffmpeg/ffmpeg_audio_decoder.h" 6 #include "services/media/framework_ffmpeg/ffmpeg_audio_decoder.h"
7 #include "services/media/framework_ffmpeg/ffmpeg_decoder.h" 7 #include "services/media/framework_ffmpeg/ffmpeg_decoder.h"
8 #include "services/media/framework_ffmpeg/ffmpeg_video_decoder.h" 8 #include "services/media/framework_ffmpeg/ffmpeg_video_decoder.h"
9 9
10 namespace mojo { 10 namespace mojo {
11 namespace media { 11 namespace media {
12 12
13 Result FfmpegDecoder::Create( 13 Result FfmpegDecoder::Create(const StreamType& stream_type,
14 const StreamType& stream_type, 14 std::shared_ptr<Decoder>* decoder_out) {
15 std::shared_ptr<Decoder>* decoder_out) {
16 DCHECK(decoder_out); 15 DCHECK(decoder_out);
17 16
18 AvCodecContextPtr av_codec_context(AvCodecContext::Create(stream_type)); 17 AvCodecContextPtr av_codec_context(AvCodecContext::Create(stream_type));
19 if (!av_codec_context) { 18 if (!av_codec_context) {
20 return Result::kUnsupportedOperation; 19 return Result::kUnsupportedOperation;
21 } 20 }
22 21
23 AVCodec* ffmpeg_decoder = avcodec_find_decoder(av_codec_context->codec_id); 22 AVCodec* ffmpeg_decoder = avcodec_find_decoder(av_codec_context->codec_id);
24 if (ffmpeg_decoder == nullptr) { 23 if (ffmpeg_decoder == nullptr) {
25 return Result::kUnsupportedOperation; 24 return Result::kUnsupportedOperation;
(...skipping 13 matching lines...) Expand all
39 *decoder_out = std::shared_ptr<Decoder>( 38 *decoder_out = std::shared_ptr<Decoder>(
40 new FfmpegVideoDecoder(std::move(av_codec_context))); 39 new FfmpegVideoDecoder(std::move(av_codec_context)));
41 break; 40 break;
42 default: 41 default:
43 return Result::kUnsupportedOperation; 42 return Result::kUnsupportedOperation;
44 } 43 }
45 44
46 return Result::kOk; 45 return Result::kOk;
47 } 46 }
48 47
49 } // namespace media 48 } // namespace media
50 } // namespace mojo 49 } // namespace mojo
OLDNEW
« no previous file with comments | « services/media/framework_ffmpeg/ffmpeg_decoder.h ('k') | services/media/framework_ffmpeg/ffmpeg_decoder_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698