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

Side by Side Diff: services/media/framework_ffmpeg/ffmpeg_video_decoder.h

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 #ifndef SERVICES_MEDIA_FRAMEWORK_FFMPEG_FFMPEG_VIDEO_DECODER_H_ 5 #ifndef SERVICES_MEDIA_FRAMEWORK_FFMPEG_FFMPEG_VIDEO_DECODER_H_
6 #define SERVICES_MEDIA_FRAMEWORK_FFMPEG_FFMPEG_VIDEO_DECODER_H_ 6 #define SERVICES_MEDIA_FRAMEWORK_FFMPEG_FFMPEG_VIDEO_DECODER_H_
7 7
8 #include "services/media/framework_ffmpeg/ffmpeg_decoder_base.h" 8 #include "services/media/framework_ffmpeg/ffmpeg_decoder_base.h"
9 9
10 namespace mojo { 10 namespace mojo {
11 namespace media { 11 namespace media {
12 12
13 // Decoder implementation employing and ffmpeg video decoder. 13 // Decoder implementation employing and ffmpeg video decoder.
14 // TODO(dalesat): Complete this. 14 // TODO(dalesat): Complete this.
15 class FfmpegVideoDecoder : public FfmpegDecoderBase { 15 class FfmpegVideoDecoder : public FfmpegDecoderBase {
16 public: 16 public:
17 FfmpegVideoDecoder(AvCodecContextPtr av_codec_context); 17 FfmpegVideoDecoder(AvCodecContextPtr av_codec_context);
18 18
19 ~FfmpegVideoDecoder() override; 19 ~FfmpegVideoDecoder() override;
20 20
21 protected: 21 protected:
22 // FfmpegDecoderBase overrides. 22 // FfmpegDecoderBase overrides.
23 int Decode( 23 int Decode(const AVPacket& av_packet,
24 const AVPacket& av_packet, 24 const ffmpeg::AvFramePtr& av_frame_ptr,
25 const ffmpeg::AvFramePtr& av_frame_ptr, 25 PayloadAllocator* allocator,
26 PayloadAllocator* allocator, 26 bool* frame_decoded_out) override;
27 bool* frame_decoded_out) override;
28 27
29 PacketPtr CreateOutputPacket( 28 PacketPtr CreateOutputPacket(const AVFrame& av_frame,
30 const AVFrame& av_frame, 29 PayloadAllocator* allocator) override;
31 PayloadAllocator* allocator) override;
32 30
33 PacketPtr CreateOutputEndOfStreamPacket() override; 31 PacketPtr CreateOutputEndOfStreamPacket() override;
34 32
35 private: 33 private:
36 // Callback used by the ffmpeg decoder to acquire a buffer. 34 // Callback used by the ffmpeg decoder to acquire a buffer.
37 static int AllocateBufferForAvFrame( 35 static int AllocateBufferForAvFrame(AVCodecContext* av_codec_context,
38 AVCodecContext* av_codec_context, 36 AVFrame* av_frame,
39 AVFrame* av_frame, 37 int flags);
40 int flags);
41 38
42 // Callback used by the ffmpeg decoder to release a buffer. 39 // Callback used by the ffmpeg decoder to release a buffer.
43 static void ReleaseBufferForAvFrame(void* opaque, uint8_t* buffer); 40 static void ReleaseBufferForAvFrame(void* opaque, uint8_t* buffer);
44 41
45 // AllocateBufferForAvFrame deposits the packet size here, because there's 42 // AllocateBufferForAvFrame deposits the packet size here, because there's
46 // no good evidence of it after avcodec_decode_audio4 completes. 43 // no good evidence of it after avcodec_decode_audio4 completes.
47 uint64_t packet_size_; 44 uint64_t packet_size_;
48 45
49 // This is used to verify that an allocated buffer is being used as expected 46 // This is used to verify that an allocated buffer is being used as expected
50 // by ffmpeg avcodec_decode_audio4. AllocateBufferForAvFrame sets it. 47 // by ffmpeg avcodec_decode_audio4. AllocateBufferForAvFrame sets it.
51 //void* packet_buffer_; 48 // void* packet_buffer_;
52 }; 49 };
53 50
54 } // namespace media 51 } // namespace media
55 } // namespace mojo 52 } // namespace mojo
56 53
57 #endif // SERVICES_MEDIA_FRAMEWORK_FFMPEG_FFMPEG_VIDEO_DECODER_H_ 54 #endif // SERVICES_MEDIA_FRAMEWORK_FFMPEG_FFMPEG_VIDEO_DECODER_H_
OLDNEW
« no previous file with comments | « services/media/framework_ffmpeg/ffmpeg_init.cc ('k') | services/media/framework_ffmpeg/ffmpeg_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698