webrtc/sdk/objc/api/peerconnection/RTCEncodedImage+Private.h
Dillon Cower 5963fddac2 Pass-by-reference instead of value to initWithNativeEncodedImage
Previously, the use of pass-by-value caused an issue in
ObjCVideoDecoder::Decode, where the EncodedImage was being copied upon
calling initWithNativeEncodedImage, which then created an NSData using
the copy's pointer; then the copy was destroyed, invalidating that
pointer.

Bug: webrtc:9378
Change-Id: Iac28b890c9902108ffc5ec54a607a99034159153
Reviewed-on: https://webrtc-review.googlesource.com/c/121922
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26598}
2019-02-08 08:56:23 +00:00

25 lines
767 B
Objective-C

/*
* Copyright 2017 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.
*/
#import "base/RTCEncodedImage.h"
#include "api/video/encoded_image.h"
NS_ASSUME_NONNULL_BEGIN
/* Interfaces for converting to/from internal C++ formats. */
@interface RTCEncodedImage (Private)
- (instancetype)initWithNativeEncodedImage:(const webrtc::EncodedImage &)encodedImage;
- (webrtc::EncodedImage)nativeEncodedImage;
@end
NS_ASSUME_NONNULL_END