Skip to content

Commit 860f729

Browse files
jttehCommit Bot
jtteh
authored and
Commit Bot
committed
Revert of Injectable Obj-C video codecs (patchset #2 id:370001 of https://codereview.webrtc.org/2979983002/ )
Reason for revert: Still having problems with no video. Reverting. Once no video is visible, no video is available from then on even if the callee app is in the foreground. Original issue's description: > Reland of Injectable Obj-C video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2979973002/ ) > > Reason for revert: > Fix the broken build file > > Original issue's description: > > Revert of Injectable Obj-C video codecs (patchset #3 id:400001 of https://codereview.webrtc.org/2981583002/ ) > > > > Reason for revert: > > Breaks bots. Build file incorrect. > > > > Original issue's description: > > > Reland of Injectable Obj-C video codecs (patchset #1 id:1 of https://codereview.webrtc.org/2975963002/ ) > > > > > > Reason for revert: > > > New CL for fixing the issues > > > > > > Original issue's description: > > > > Revert of Injectable Obj-C video codecs (patchset #8 id:140001 of https://codereview.webrtc.org/2966023002/ ) > > > > > > > > Reason for revert: > > > > Causes no video in certain scenarios. Please come up with a test plan or unit test to prevent such problems in the future. > > > > > > > > Original issue's description: > > > > > Injectable Obj-C video codecs > > > > > > > > > > Initial CL for this effort, with a working RTCVideoEncoder/Decoder for H264 > > > > > (wrapping the VideoToolbox codec). > > > > > > > > > > Some notes / things left to do: > > > > > - There are some hard-coded references to codec types that are supported by > > > > > webrtc::VideoCodec, cricket::VideoCodec, webrtc::CodecSpecificInfo etc > > > > > since we need to convert to/from these types in ObjCVideoEncoder/Decoder. > > > > > These types would need to be more codec agnostic to avoid this. > > > > > - Most interfaces are borrowed from the design document for injectable > > > > > codecs in Android. Some data in the corresponding C++ classes is discarded > > > > > when converting to the Obj-C version, since it has fewer fields. I have not > > > > > verified whether all data that we do keep is needed, or whether we might be > > > > > losing anything useful in these conversions. > > > > > - Implement the VideoToolbox codec code directly in the RTCVideoEncoderH264 > > > > > classes, instead of wrapping webrtc::H264VideoToolboxEncoder / decoder. > > > > > Eliminates converting between ObjC/C++ types outside the ObjCVideoEncoder/ > > > > > Decoder wrapper classes. > > > > > - List the injected codec factory's supported codecs in the list of codecs in > > > > > AppRTCMobile. > > > > > > > > > > BUG=webrtc:7924 > > > > > [email protected] > > > > > > > > > > Review-Url: https://codereview.webrtc.org/2966023002 . > > > > > Cr-Commit-Position: refs/heads/master@{#18928} > > > > > Committed: https://chromium.googlesource.com/external/webrtc/+/a0349c138db62c52435be84b6c837f5f4758e264 > > > > > > > > [email protected],[email protected] > > > > # Not skipping CQ checks because original CL landed more than 1 days ago. > > > > BUG=webrtc:7924 > > > > NOTRY=true > > > > > > > > Review-Url: https://codereview.webrtc.org/2975963002 > > > > Cr-Commit-Position: refs/heads/master@{#18979} > > > > Committed: https://chromium.googlesource.com/external/webrtc/+/1095ada7ad56fe29b7b2bbc560a8f6475a7978ce > > > > > > [email protected] > > > [email protected] > > > # Skipping CQ checks because original CL landed less than 1 days ago. > > > NOPRESUBMIT=true > > > NOTREECHECKS=true > > > NOTRY=true > > > BUG=webrtc:7924 > > > > > > Review-Url: https://codereview.webrtc.org/2981583002 . > > > Cr-Commit-Position: refs/heads/master@{#19002} > > > Committed: https://chromium.googlesource.com/external/webrtc/+/a5f1de1e6541de03f944bcbf49be87c01f57a18b > > > > [email protected],[email protected],[email protected],[email protected] > > # Skipping CQ checks because original CL landed less than 1 days ago. > > NOPRESUBMIT=true > > NOTREECHECKS=true > > NOTRY=true > > BUG=webrtc:7924 > > > > Review-Url: https://codereview.webrtc.org/2979973002 > > Cr-Commit-Position: refs/heads/master@{#19004} > > Committed: https://chromium.googlesource.com/external/webrtc/+/81d40ee1491d5229c2677cc04b1f40d67c2babef > > [email protected],[email protected],[email protected],[email protected] > BUG=webrtc:7924 > > Review-Url: https://codereview.webrtc.org/2979983002 > Cr-Commit-Position: refs/heads/master@{#19005} > Committed: https://chromium.googlesource.com/external/webrtc/+/732a3437da4db7b452758b8e1cf26fce0ce3bf65 [email protected],[email protected],[email protected],[email protected],[email protected] # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=webrtc:7924 Review-Url: https://codereview.webrtc.org/2980173002 Cr-Commit-Position: refs/heads/master@{#19036}
1 parent d295e40 commit 860f729

21 files changed

+10
-1446
lines changed

webrtc/sdk/BUILD.gn

-23
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,6 @@ if (is_ios || is_mac) {
310310
sources = [
311311
"objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory+Private.h",
312312
"objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory.mm",
313-
"objc/Framework/Classes/PeerConnection/RTCVideoCodecH264.mm",
314-
"objc/Framework/Classes/PeerConnection/objc_video_decoder_factory.h",
315-
"objc/Framework/Classes/PeerConnection/objc_video_decoder_factory.mm",
316-
"objc/Framework/Classes/PeerConnection/objc_video_encoder_factory.h",
317-
"objc/Framework/Classes/PeerConnection/objc_video_encoder_factory.mm",
318313
]
319314

320315
public_configs = [ ":objc_common_config" ]
@@ -331,16 +326,11 @@ if (is_ios || is_mac) {
331326
":objc_peerconnectionfactory_base",
332327
":objc_video",
333328
":objc_videotoolbox",
334-
":objc_videotracksource",
335329
"../api:video_frame_api",
336-
"../api/video_codecs:video_codecs_api",
337330
"../base:rtc_base",
338-
"../media:rtc_audio_video",
339331
"../media:rtc_media_base",
340-
"../modules:module_api",
341332
"../pc:create_pc_factory",
342333
"../pc:peerconnection",
343-
"../system_wrappers:field_trial_api",
344334
]
345335
}
346336

@@ -387,7 +377,6 @@ if (is_ios || is_mac) {
387377
"objc/Framework/Classes/PeerConnection/RTCDataChannel.mm",
388378
"objc/Framework/Classes/PeerConnection/RTCDataChannelConfiguration+Private.h",
389379
"objc/Framework/Classes/PeerConnection/RTCDataChannelConfiguration.mm",
390-
"objc/Framework/Classes/PeerConnection/RTCEncodedImage.mm",
391380
"objc/Framework/Classes/PeerConnection/RTCIceCandidate+Private.h",
392381
"objc/Framework/Classes/PeerConnection/RTCIceCandidate.mm",
393382
"objc/Framework/Classes/PeerConnection/RTCIceServer+Private.h",
@@ -415,7 +404,6 @@ if (is_ios || is_mac) {
415404
"objc/Framework/Classes/PeerConnection/RTCRtpCodecParameters.mm",
416405
"objc/Framework/Classes/PeerConnection/RTCRtpEncodingParameters+Private.h",
417406
"objc/Framework/Classes/PeerConnection/RTCRtpEncodingParameters.mm",
418-
"objc/Framework/Classes/PeerConnection/RTCRtpFragmentationHeader.mm",
419407
"objc/Framework/Classes/PeerConnection/RTCRtpParameters+Private.h",
420408
"objc/Framework/Classes/PeerConnection/RTCRtpParameters.mm",
421409
"objc/Framework/Classes/PeerConnection/RTCRtpReceiver+Private.h",
@@ -427,8 +415,6 @@ if (is_ios || is_mac) {
427415
"objc/Framework/Classes/PeerConnection/RTCSessionDescription.mm",
428416
"objc/Framework/Classes/PeerConnection/RTCTracing.mm",
429417
"objc/Framework/Classes/PeerConnection/RTCVideoCapturer.m",
430-
"objc/Framework/Classes/PeerConnection/RTCVideoCodec+Private.h",
431-
"objc/Framework/Classes/PeerConnection/RTCVideoCodec.mm",
432418
"objc/Framework/Classes/PeerConnection/RTCVideoFrame.mm",
433419
"objc/Framework/Classes/PeerConnection/RTCVideoRendererAdapter+Private.h",
434420
"objc/Framework/Classes/PeerConnection/RTCVideoRendererAdapter.h",
@@ -490,7 +476,6 @@ if (is_ios || is_mac) {
490476
"../base:rtc_base",
491477
"../common_video",
492478
"../media:rtc_media_base",
493-
"../modules:module_api",
494479
"../pc:peerconnection",
495480
]
496481
}
@@ -516,8 +501,6 @@ if (is_ios || is_mac) {
516501
"objc/Framework/UnitTests/RTCSessionDescriptionTest.mm",
517502
"objc/Framework/UnitTests/RTCTracingTest.mm",
518503
"objc/Framework/UnitTests/avformatmappertests.mm",
519-
"objc/Framework/UnitTests/objc_video_decoder_factory_tests.mm",
520-
"objc/Framework/UnitTests/objc_video_encoder_factory_tests.mm",
521504
]
522505
if (is_ios &&
523506
!(use_ios_simulator &&
@@ -535,11 +518,8 @@ if (is_ios || is_mac) {
535518
defines = [ "GTEST_RELATIVE_PATH" ]
536519
deps = [
537520
":objc_peerconnection",
538-
":objc_peerconnectionfactory",
539-
":objc_videotracksource",
540521
"..//system_wrappers:system_wrappers_default",
541522
"../base:rtc_base_tests_utils",
542-
"../modules:module_api",
543523
"../system_wrappers:system_wrappers_default",
544524
"//third_party/ocmock",
545525
]
@@ -573,8 +553,6 @@ if (is_ios || is_mac) {
573553

574554
common_objc_headers = [
575555
"objc/Framework/Headers/WebRTC/RTCAudioSession.h",
576-
"objc/Framework/Headers/WebRTC/RTCVideoCodec.h",
577-
"objc/Framework/Headers/WebRTC/RTCVideoCodecFactory.h",
578556
"objc/Framework/Headers/WebRTC/RTCAudioSessionConfiguration.h",
579557
"objc/Framework/Headers/WebRTC/RTCAVFoundationVideoSource.h",
580558
"objc/Framework/Headers/WebRTC/RTCAudioSource.h",
@@ -617,7 +595,6 @@ if (is_ios || is_mac) {
617595
"objc/Framework/Headers/WebRTC/RTCVideoTrack.h",
618596
"objc/Framework/Headers/WebRTC/RTCVideoViewShading.h",
619597
"objc/Framework/Headers/WebRTC/UIDevice+RTCDevice.h",
620-
"objc/Framework/Headers/WebRTC/RTCVideoCodecH264.h",
621598
"objc/Framework/Headers/WebRTC/WebRTC.h",
622599
]
623600
if (rtc_use_metal_rendering) {

webrtc/sdk/objc/Framework/Classes/Common/helpers.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#ifndef WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_COMMON_HELPERS_H_
1212
#define WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_COMMON_HELPERS_H_
1313

14+
#if defined(WEBRTC_IOS)
15+
1416
#include <string>
1517

1618
namespace webrtc {
@@ -31,7 +33,6 @@ std::string GetThreadInfo();
3133
// Example: <NSThread: 0x170066d80>{number = 1, name = main}
3234
std::string GetCurrentThreadDescription();
3335

34-
#if defined(WEBRTC_IOS)
3536
// Returns the current name of the operating system.
3637
std::string GetSystemName();
3738

@@ -45,7 +46,6 @@ double GetSystemVersion();
4546
// Returns the device type.
4647
// Examples: ”iPhone” and ”iPod touch”.
4748
std::string GetDeviceType();
48-
#endif // defined(WEBRTC_IOS)
4949

5050
// Returns a more detailed device name.
5151
// Examples: "iPhone 5s (GSM)" and "iPhone 6 Plus".
@@ -65,12 +65,12 @@ std::string GetOSVersionString();
6565
// Returns the number of processing cores available on the device.
6666
int GetProcessorCount();
6767

68-
#if defined(WEBRTC_IOS)
6968
// Indicates whether Low Power Mode is enabled on the iOS device.
7069
bool GetLowPowerModeEnabled();
71-
#endif
7270

7371
} // namespace ios
7472
} // namespace webrtc
7573

74+
#endif // defined(WEBRTC_IOS)
75+
7676
#endif // WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_COMMON_HELPERS_H_

webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCEncodedImage.mm

-74
This file was deleted.

webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory.mm

+5-26
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,18 @@
1111
#import "RTCPeerConnectionFactory+Private.h"
1212

1313
#import "NSString+StdString.h"
14-
#import "RTCAVFoundationVideoSource+Private.h"
1514
#import "RTCAudioSource+Private.h"
1615
#import "RTCAudioTrack+Private.h"
1716
#import "RTCMediaConstraints+Private.h"
1817
#import "RTCMediaStream+Private.h"
1918
#import "RTCPeerConnection+Private.h"
2019
#import "RTCVideoSource+Private.h"
2120
#import "RTCVideoTrack+Private.h"
21+
#import "RTCAVFoundationVideoSource+Private.h"
2222
#import "WebRTC/RTCLogging.h"
23-
#import "WebRTC/RTCVideoCodecFactory.h"
24-
#ifndef HAVE_NO_MEDIA
25-
#import "WebRTC/RTCVideoCodecH264.h"
26-
#endif
2723

28-
#include "PeerConnection/objc_video_decoder_factory.h"
29-
#include "PeerConnection/objc_video_encoder_factory.h"
3024
#include "Video/objcvideotracksource.h"
25+
#include "VideoToolbox/videocodecfactory.h"
3126
#include "webrtc/api/videosourceproxy.h"
3227
// Adding the nogncheck to disable the including header check.
3328
// The no-media version PeerConnectionFactory doesn't depend on media related
@@ -46,17 +41,7 @@ @implementation RTCPeerConnectionFactory {
4641
@synthesize nativeFactory = _nativeFactory;
4742

4843
- (instancetype)init {
49-
#ifdef HAVE_NO_MEDIA
50-
return [self initWithEncoderFactory:nil decoderFactory:nil];
51-
#else
52-
return [self initWithEncoderFactory:[[RTCVideoEncoderFactoryH264 alloc] init]
53-
decoderFactory:[[RTCVideoDecoderFactoryH264 alloc] init]];
54-
#endif
55-
}
56-
57-
- (instancetype)initWithEncoderFactory:(nullable id<RTCVideoEncoderFactory>)encoderFactory
58-
decoderFactory:(nullable id<RTCVideoDecoderFactory>)decoderFactory {
59-
if (self = [super init]) {
44+
if ((self = [super init])) {
6045
_networkThread = rtc::Thread::CreateWithSocketServer();
6146
BOOL result = _networkThread->Start();
6247
NSAssert(result, @"Failed to start network thread.");
@@ -83,14 +68,8 @@ - (instancetype)initWithEncoderFactory:(nullable id<RTCVideoEncoderFactory>)enco
8368
std::unique_ptr<webrtc::CallFactoryInterface>(),
8469
std::unique_ptr<webrtc::RtcEventLogFactoryInterface>());
8570
#else
86-
cricket::WebRtcVideoEncoderFactory *encoder_factory = nullptr;
87-
cricket::WebRtcVideoDecoderFactory *decoder_factory = nullptr;
88-
if (encoderFactory) {
89-
encoder_factory = new webrtc::ObjCVideoEncoderFactory(encoderFactory);
90-
}
91-
if (decoderFactory) {
92-
decoder_factory = new webrtc::ObjCVideoDecoderFactory(decoderFactory);
93-
}
71+
const auto encoder_factory = new webrtc::VideoToolboxVideoEncoderFactory();
72+
const auto decoder_factory = new webrtc::VideoToolboxVideoDecoderFactory();
9473

9574
// Ownership of encoder/decoder factories is passed on to the
9675
// peerconnectionfactory, that handles deleting them.

webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCRtpFragmentationHeader.mm

-61
This file was deleted.

webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoCodec+Private.h

-57
This file was deleted.

0 commit comments

Comments
 (0)