Obj-C SDK Cleanup
This CL separates the files under sdk/objc into logical directories, replacing the previous file layout under Framework/. A long term goal is to have some system set up to generate the files under sdk/objc/api (the PeerConnection API wrappers) from the C++ code. In the shorter term the goal is to abstract out shared concepts from these classes in order to make them as uniform as possible. The separation into base/, components/, and helpers/ are to differentiate between the base layer's common protocols, various utilities and the actual platform specific components. The old directory layout that resembled a framework's internal layout is not necessary, since it is generated by the framework target when building it. Bug: webrtc:9627 Change-Id: Ib084fd83f050ae980649ca99e841f4fb0580bd8f Reviewed-on: https://webrtc-review.googlesource.com/94142 Reviewed-by: Kári Helgason <kthelgason@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> Reviewed-by: Henrik Andreassson <henrika@webrtc.org> Commit-Queue: Anders Carlsson <andersc@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24493}
This commit is contained in:
committed by
Commit Bot
parent
9ea5765f78
commit
7bca8ca4e2
@ -8,17 +8,4 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef SDK_OBJC_FRAMEWORK_NATIVE_API_AUDIO_DEVICE_MODULE_H_
|
||||
#define SDK_OBJC_FRAMEWORK_NATIVE_API_AUDIO_DEVICE_MODULE_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "modules/audio_device/include/audio_device.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
rtc::scoped_refptr<AudioDeviceModule> CreateAudioDeviceModule();
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // SDK_OBJC_FRAMEWORK_NATIVE_API_AUDIO_DEVICE_MODULE_H_
|
||||
#import "native/api/audio_device_module.h"
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Copyright 2018 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.
|
||||
*/
|
||||
|
||||
#include "audio_device_module.h"
|
||||
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/refcountedobject.h"
|
||||
|
||||
#include "sdk/objc/Framework/Native/src/audio/audio_device_module_ios.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
rtc::scoped_refptr<AudioDeviceModule> CreateAudioDeviceModule() {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
#if defined(WEBRTC_IOS)
|
||||
return new rtc::RefCountedObject<ios_adm::AudioDeviceModuleIOS>();
|
||||
#else
|
||||
RTC_LOG(LERROR)
|
||||
<< "current platform is not supported => this module will self destruct!";
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* Copyright 2018 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 SDK_OBJC_FRAMEWORK_NATIVE_API_VIDEO_CAPTURER_H_
|
||||
#define SDK_OBJC_FRAMEWORK_NATIVE_API_VIDEO_CAPTURER_H_
|
||||
|
||||
#import "WebRTC/RTCVideoCapturer.h"
|
||||
|
||||
#include "api/mediastreaminterface.h"
|
||||
#include "rtc_base/scoped_ref_ptr.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
rtc::scoped_refptr<webrtc::VideoTrackSourceInterface> ObjCToNativeVideoCapturer(
|
||||
RTCVideoCapturer* objc_video_capturer,
|
||||
rtc::Thread* signaling_thread,
|
||||
rtc::Thread* worker_thread);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // SDK_OBJC_FRAMEWORK_NATIVE_API_VIDEO_CAPTURER_H_
|
||||
@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Copyright 2018 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.
|
||||
*/
|
||||
|
||||
#include "sdk/objc/Framework/Native/api/video_capturer.h"
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/videosourceproxy.h"
|
||||
#include "sdk/objc/Framework/Native/src/objc_video_track_source.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
rtc::scoped_refptr<webrtc::VideoTrackSourceInterface> ObjCToNativeVideoCapturer(
|
||||
RTCVideoCapturer *objc_video_capturer,
|
||||
rtc::Thread *signaling_thread,
|
||||
rtc::Thread *worker_thread) {
|
||||
RTCObjCVideoSourceAdapter *adapter = [[RTCObjCVideoSourceAdapter alloc] init];
|
||||
rtc::scoped_refptr<webrtc::ObjCVideoTrackSource> objc_video_track_source(
|
||||
new rtc::RefCountedObject<webrtc::ObjCVideoTrackSource>(adapter));
|
||||
rtc::scoped_refptr<webrtc::VideoTrackSourceInterface> video_source =
|
||||
webrtc::VideoTrackSourceProxy::Create(
|
||||
signaling_thread, worker_thread, objc_video_track_source);
|
||||
|
||||
objc_video_capturer.delegate = adapter;
|
||||
|
||||
return video_source;
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
@ -8,20 +8,4 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef SDK_OBJC_FRAMEWORK_NATIVE_API_VIDEO_DECODER_FACTORY_H_
|
||||
#define SDK_OBJC_FRAMEWORK_NATIVE_API_VIDEO_DECODER_FACTORY_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#import "WebRTC/RTCVideoCodecFactory.h"
|
||||
|
||||
#include "api/video_codecs/video_decoder_factory.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
std::unique_ptr<VideoDecoderFactory> ObjCToNativeVideoDecoderFactory(
|
||||
id<RTCVideoDecoderFactory> objc_video_decoder_factory);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // SDK_OBJC_FRAMEWORK_NATIVE_API_VIDEO_DECODER_FACTORY_H_
|
||||
#import "native/api/video_decoder_factory.h"
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Copyright 2018 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.
|
||||
*/
|
||||
|
||||
#include "sdk/objc/Framework/Native/api/video_decoder_factory.h"
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "sdk/objc/Framework/Native/src/objc_video_decoder_factory.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
std::unique_ptr<VideoDecoderFactory> ObjCToNativeVideoDecoderFactory(
|
||||
id<RTCVideoDecoderFactory> objc_video_decoder_factory) {
|
||||
return absl::make_unique<ObjCVideoDecoderFactory>(objc_video_decoder_factory);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
@ -8,20 +8,4 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef SDK_OBJC_FRAMEWORK_NATIVE_API_VIDEO_ENCODER_FACTORY_H_
|
||||
#define SDK_OBJC_FRAMEWORK_NATIVE_API_VIDEO_ENCODER_FACTORY_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#import "WebRTC/RTCVideoCodecFactory.h"
|
||||
|
||||
#include "api/video_codecs/video_encoder_factory.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
std::unique_ptr<VideoEncoderFactory> ObjCToNativeVideoEncoderFactory(
|
||||
id<RTCVideoEncoderFactory> objc_video_encoder_factory);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // SDK_OBJC_FRAMEWORK_NATIVE_API_VIDEO_ENCODER_FACTORY_H_
|
||||
#import "native/api/video_encoder_factory.h"
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Copyright 2018 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.
|
||||
*/
|
||||
|
||||
#include "sdk/objc/Framework/Native/api/video_encoder_factory.h"
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "sdk/objc/Framework/Native/src/objc_video_encoder_factory.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
std::unique_ptr<VideoEncoderFactory> ObjCToNativeVideoEncoderFactory(
|
||||
id<RTCVideoEncoderFactory> objc_video_encoder_factory) {
|
||||
return absl::make_unique<ObjCVideoEncoderFactory>(objc_video_encoder_factory);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
@ -1,24 +0,0 @@
|
||||
/*
|
||||
* Copyright 2018 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 SDK_OBJC_FRAMEWORK_NATIVE_API_VIDEO_FRAME_H_
|
||||
#define SDK_OBJC_FRAMEWORK_NATIVE_API_VIDEO_FRAME_H_
|
||||
|
||||
#import "WebRTC/RTCVideoFrame.h"
|
||||
|
||||
#include "api/video/video_frame.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
RTCVideoFrame* NativeToObjCVideoFrame(const VideoFrame& frame);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // SDK_OBJC_FRAMEWORK_NATIVE_API_VIDEO_FRAME_H_
|
||||
@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Copyright 2018 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.
|
||||
*/
|
||||
|
||||
#include "sdk/objc/Framework/Native/api/video_frame.h"
|
||||
|
||||
#include "sdk/objc/Framework/Native/src/objc_video_frame.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
RTCVideoFrame* NativeToObjCVideoFrame(const VideoFrame& frame) {
|
||||
return ToObjCVideoFrame(frame);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
|
||||
* Copyright (c) 2015 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
|
||||
@ -8,22 +8,4 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef SDK_OBJC_FRAMEWORK_NATIVE_API_VIDEO_FRAME_BUFFER_H_
|
||||
#define SDK_OBJC_FRAMEWORK_NATIVE_API_VIDEO_FRAME_BUFFER_H_
|
||||
|
||||
#import "WebRTC/RTCVideoFrameBuffer.h"
|
||||
|
||||
#include "common_video/include/video_frame_buffer.h"
|
||||
#include "rtc_base/scoped_ref_ptr.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
rtc::scoped_refptr<VideoFrameBuffer> ObjCToNativeVideoFrameBuffer(
|
||||
id<RTCVideoFrameBuffer> objc_video_frame_buffer);
|
||||
|
||||
id<RTCVideoFrameBuffer> NativeToObjCVideoFrameBuffer(
|
||||
const rtc::scoped_refptr<VideoFrameBuffer>& buffer);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // SDK_OBJC_FRAMEWORK_NATIVE_API_VIDEO_FRAME_BUFFER_H_
|
||||
#import "native/api/video_frame_buffer.h"
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* Copyright 2018 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.
|
||||
*/
|
||||
|
||||
#include "sdk/objc/Framework/Native/api/video_frame_buffer.h"
|
||||
|
||||
#include "sdk/objc/Framework/Native/src/objc_frame_buffer.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
rtc::scoped_refptr<VideoFrameBuffer> ObjCToNativeVideoFrameBuffer(
|
||||
id<RTCVideoFrameBuffer> objc_video_frame_buffer) {
|
||||
return new rtc::RefCountedObject<ObjCFrameBuffer>(objc_video_frame_buffer);
|
||||
}
|
||||
|
||||
id<RTCVideoFrameBuffer> NativeToObjCVideoFrameBuffer(
|
||||
const rtc::scoped_refptr<VideoFrameBuffer> &buffer) {
|
||||
return ToObjCVideoFrameBuffer(buffer);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* Copyright 2018 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 SDK_OBJC_FRAMEWORK_NATIVE_API_VIDEO_RENDERER_H_
|
||||
#define SDK_OBJC_FRAMEWORK_NATIVE_API_VIDEO_RENDERER_H_
|
||||
|
||||
#import "WebRTC/RTCVideoRenderer.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "api/video/video_frame.h"
|
||||
#include "api/video/video_sink_interface.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
std::unique_ptr<rtc::VideoSinkInterface<VideoFrame>> ObjCToNativeVideoRenderer(
|
||||
id<RTCVideoRenderer> objc_video_renderer);
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // SDK_OBJC_FRAMEWORK_NATIVE_API_VIDEO_RENDERER_H_
|
||||
@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Copyright 2018 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.
|
||||
*/
|
||||
|
||||
#include "sdk/objc/Framework/Native/api/video_renderer.h"
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "sdk/objc/Framework/Native/src/objc_video_renderer.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
std::unique_ptr<rtc::VideoSinkInterface<VideoFrame>> ObjCToNativeVideoRenderer(
|
||||
id<RTCVideoRenderer> objc_video_renderer) {
|
||||
return absl::make_unique<ObjCVideoRenderer>(objc_video_renderer);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
Reference in New Issue
Block a user