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

Side by Side Diff: webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.h

Issue 1187573004: iOS HW H264 support. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Move unittest file. Created 5 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 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 *
10 */
11
12 #ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_VIDEO_TOOLBOX_ENCODER_H_
13 #define WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_VIDEO_TOOLBOX_ENCODER_H_
14
15 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h"
16
17 #if defined(WEBRTC_VIDEO_TOOLBOX_SUPPORTED)
18
19 #include <VideoToolbox/VideoToolbox.h>
20 #include <vector>
21
22 // This file provides a H264 encoder implementation using the VideoToolbox
23 // APIs. Since documentation is almost non-existent, this is largely based on
24 // the information in the VideoToolbox header files, a talk from WWDC 2014 and
25 // experimentation.
26
27 namespace webrtc {
28
29 class H264VideoToolboxEncoder : public H264Encoder {
30 public:
31 H264VideoToolboxEncoder();
32
33 ~H264VideoToolboxEncoder() override;
34
35 int InitEncode(const VideoCodec* codec_settings,
36 int number_of_cores,
37 size_t max_payload_size) override;
38
39 int Encode(const VideoFrame& input_image,
40 const CodecSpecificInfo* codec_specific_info,
41 const std::vector<VideoFrameType>* frame_types) override;
42
43 int RegisterEncodeCompleteCallback(EncodedImageCallback* callback) override;
44
45 int SetChannelParameters(uint32_t packet_loss, int64_t rtt) override;
46
47 int SetRates(uint32_t new_bitrate_kbit, uint32_t frame_rate) override;
48
49 int Release() override;
50
51 private:
52 int ResetCompressionSession();
53 void ConfigureCompressionSession();
54 void DestroyCompressionSession();
55
56 webrtc::EncodedImageCallback* callback_;
57 VTCompressionSessionRef compression_session_;
58 int32_t bitrate_; // Bitrate in bits per second.
59 int32_t width_;
60 int32_t height_;
61 }; // H264VideoToolboxEncoder
62
63 } // namespace webrtc
64
65 #endif // defined(WEBRTC_VIDEO_TOOLBOX_SUPPORTED)
66 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_VIDEO_TOOLBOX_ENCODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698