Chromium Code Reviews

Side by Side Diff: talk/app/webrtc/objc/RTCVideoRendererAdapter.mm

Issue 1838353004: cricket::VideoFrame cleanup. New width() and height(). Deleted GetChroma* methods. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix int vs size_t comparison. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 28 matching lines...)
39 class RTCVideoRendererNativeAdapter 39 class RTCVideoRendererNativeAdapter
40 : public rtc::VideoSinkInterface<cricket::VideoFrame> { 40 : public rtc::VideoSinkInterface<cricket::VideoFrame> {
41 public: 41 public:
42 RTCVideoRendererNativeAdapter(RTCVideoRendererAdapter* adapter) { 42 RTCVideoRendererNativeAdapter(RTCVideoRendererAdapter* adapter) {
43 _adapter = adapter; 43 _adapter = adapter;
44 _size = CGSizeZero; 44 _size = CGSizeZero;
45 } 45 }
46 46
47 void OnFrame(const cricket::VideoFrame& videoFrame) override { 47 void OnFrame(const cricket::VideoFrame& videoFrame) override {
48 const cricket::VideoFrame* frame = videoFrame.GetCopyWithRotationApplied(); 48 const cricket::VideoFrame* frame = videoFrame.GetCopyWithRotationApplied();
49 CGSize currentSize = CGSizeMake(frame->GetWidth(), frame->GetHeight()); 49 CGSize currentSize = CGSizeMake(frame->width(), frame->height());
50 if (!CGSizeEqualToSize(_size, currentSize)) { 50 if (!CGSizeEqualToSize(_size, currentSize)) {
51 _size = currentSize; 51 _size = currentSize;
52 [_adapter.videoRenderer setSize:_size]; 52 [_adapter.videoRenderer setSize:_size];
53 } 53 }
54 RTCI420Frame* i420Frame = [[RTCI420Frame alloc] initWithVideoFrame:frame]; 54 RTCI420Frame* i420Frame = [[RTCI420Frame alloc] initWithVideoFrame:frame];
55 [_adapter.videoRenderer renderFrame:i420Frame]; 55 [_adapter.videoRenderer renderFrame:i420Frame];
56 } 56 }
57 57
58 private: 58 private:
59 __weak RTCVideoRendererAdapter* _adapter; 59 __weak RTCVideoRendererAdapter* _adapter;
(...skipping 13 matching lines...)
73 _adapter.reset(new webrtc::RTCVideoRendererNativeAdapter(self)); 73 _adapter.reset(new webrtc::RTCVideoRendererNativeAdapter(self));
74 } 74 }
75 return self; 75 return self;
76 } 76 }
77 77
78 - (rtc::VideoSinkInterface<cricket::VideoFrame> *)nativeVideoRenderer { 78 - (rtc::VideoSinkInterface<cricket::VideoFrame> *)nativeVideoRenderer {
79 return _adapter.get(); 79 return _adapter.get();
80 } 80 }
81 81
82 @end 82 @end
OLDNEW

Powered by Google App Engine