webrtc_m130/webrtc/sdk/objc/Framework/Classes/videotoolboxvideocodecfactory.h
kthelgason 6a5047dad3 Add a webrtc{en,de}coderfactory implementation for VideoToolbox
This CL removes the coupling of the VideoToolbox h264 implementation
to the generic h264 code. The files have been moved into sdb/obj/Framework
and all dependency on them has been removed from the rest of WebRTC.
We now add it as an external encoder via a factory supplied to the
CreatePeerConnectionFactory call. This also brings the iOS implementation
closer to what we do on Android for MediaCodec.

BUG=webrtc:6619

Review-Url: https://codereview.webrtc.org/2463313002
Cr-Commit-Position: refs/heads/master@{#14953}
2016-11-07 15:26:05 +00:00

51 lines
1.7 KiB
C++

/*
* Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*
*/
#ifndef WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_VIDEOTOOLBOXVIDEOCODECFACTORY_H_
#define WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_VIDEOTOOLBOXVIDEOCODECFACTORY_H_
#include "webrtc/media/engine/webrtcvideoencoderfactory.h"
#include "webrtc/media/engine/webrtcvideodecoderfactory.h"
namespace webrtc {
class VideoToolboxVideoEncoderFactory
: public cricket::WebRtcVideoEncoderFactory {
public:
VideoToolboxVideoEncoderFactory();
~VideoToolboxVideoEncoderFactory();
// WebRtcVideoEncoderFactory implementation.
VideoEncoder* CreateVideoEncoder(const cricket::VideoCodec& codec) override;
void DestroyVideoEncoder(VideoEncoder* encoder) override;
const std::vector<cricket::VideoCodec>& supported_codecs() const override;
private:
std::vector<cricket::VideoCodec> supported_codecs_;
};
class VideoToolboxVideoDecoderFactory
: public cricket::WebRtcVideoDecoderFactory {
public:
VideoToolboxVideoDecoderFactory();
~VideoToolboxVideoDecoderFactory();
// WebRtcVideoDecoderFactory implementation.
VideoDecoder* CreateVideoDecoder(VideoCodecType type) override;
void DestroyVideoDecoder(VideoDecoder* decoder) override;
private:
std::vector<cricket::VideoCodec> supported_codecs_;
};
} // namespace webrtc
#endif // WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_VIDEOTOOLBOXVIDEOCODECFACTORY_H_