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

Side by Side Diff: content/renderer/media/rtc_video_encoder.h

Issue 2095393002: Add posciak and wuchengli to WebRTC HW decoder and encoder files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove duplicated owners Created 4 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
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_MEDIA_RTC_VIDEO_ENCODER_H_
6 #define CONTENT_RENDERER_MEDIA_RTC_VIDEO_ENCODER_H_
7
8 #include <stddef.h>
9 #include <stdint.h>
10
11 #include <memory>
12 #include <vector>
13
14 #include "base/macros.h"
15 #include "base/memory/ref_counted.h"
16 #include "base/memory/weak_ptr.h"
17 #include "base/threading/thread_checker.h"
18 #include "base/time/time.h"
19 #include "content/common/content_export.h"
20 #include "media/base/video_decoder_config.h"
21 #include "third_party/webrtc/modules/video_coding/include/video_codec_interface. h"
22 #include "ui/gfx/geometry/size.h"
23
24 namespace media {
25 class GpuVideoAcceleratorFactories;
26 } // namespace media
27
28 namespace content {
29
30 // RTCVideoEncoder uses a media::VideoEncodeAccelerator to implement a
31 // webrtc::VideoEncoder class for WebRTC. Internally, VEA methods are
32 // trampolined to a private RTCVideoEncoder::Impl instance. The Impl class runs
33 // on the worker thread queried from the |gpu_factories_|, which is presently
34 // the media thread. RTCVideoEncoder is sychronized by webrtc::VideoSender.
35 // webrtc::VideoEncoder methods do not run concurrently. RtcVideoEncoder needs
36 // to synchronize RegisterEncodeCompleteCallback and encode complete callback.
37 class CONTENT_EXPORT RTCVideoEncoder
38 : NON_EXPORTED_BASE(public webrtc::VideoEncoder) {
39 public:
40 RTCVideoEncoder(webrtc::VideoCodecType type,
41 media::GpuVideoAcceleratorFactories* gpu_factories);
42 ~RTCVideoEncoder() override;
43
44 // webrtc::VideoEncoder implementation. Tasks are posted to |impl_| using the
45 // appropriate VEA methods.
46 int32_t InitEncode(const webrtc::VideoCodec* codec_settings,
47 int32_t number_of_cores,
48 size_t max_payload_size) override;
49 int32_t Encode(
50 const webrtc::VideoFrame& input_image,
51 const webrtc::CodecSpecificInfo* codec_specific_info,
52 const std::vector<webrtc::FrameType>* frame_types) override;
53 int32_t RegisterEncodeCompleteCallback(
54 webrtc::EncodedImageCallback* callback) override;
55 int32_t Release() override;
56 int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override;
57 int32_t SetRates(uint32_t new_bit_rate, uint32_t frame_rate) override;
58
59 private:
60 class Impl;
61 friend class RTCVideoEncoder::Impl;
62
63 void RecordInitEncodeUMA(int32_t init_retval,
64 media::VideoCodecProfile profile);
65
66 // The video codec type, as reported to WebRTC.
67 const webrtc::VideoCodecType video_codec_type_;
68
69 // Factory for creating VEAs, shared memory buffers, etc.
70 media::GpuVideoAcceleratorFactories* gpu_factories_;
71
72 // Task runner that the video accelerator runs on.
73 const scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner_;
74
75 // The RTCVideoEncoder::Impl that does all the work.
76 scoped_refptr<Impl> impl_;
77
78 DISALLOW_COPY_AND_ASSIGN(RTCVideoEncoder);
79 };
80
81 } // namespace content
82
83 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_ENCODER_H_
OLDNEW
« no previous file with comments | « content/renderer/media/rtc_video_decoder_unittest.cc ('k') | content/renderer/media/rtc_video_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698