Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions sdk/android/api/org/webrtc/VideoTrack.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ public boolean shouldReceive(){
return nativeGetShouldReceive(getNativeMediaStreamTrack());
}

public void setContentHint(int val) {
nativeSetContentHint(getNativeMediaStreamTrack(), val);
}

public int contentHint() {
return nativeGetContentHint(getNativeMediaStreamTrack());
}

@Override
public void dispose() {
for (long nativeSink : sinks.values()) {
Expand All @@ -93,4 +101,6 @@ public long getNativeVideoTrack() {
private static native void nativeFreeSink(long sink);
private static native void nativeSetShouldReceive(long track, boolean shouldReceive);
private static native boolean nativeGetShouldReceive(long track);
private static native void nativeSetContentHint(long track, int val);
private static native int nativeGetContentHint(long track);
}
10 changes: 10 additions & 0 deletions sdk/android/src/jni/video_track.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,15 @@ static jboolean JNI_VideoTrack_GetShouldReceive(JNIEnv* jni,
return reinterpret_cast<VideoTrackInterface*>(j_native_track)->should_receive();
}

static void JNI_VideoTrack_SetContentHint(JNIEnv* jni,
jlong j_native_track,
jint val) {
reinterpret_cast<VideoTrackInterface*>(j_native_track)->set_content_hint((webrtc::VideoTrackInterface::ContentHint)val);
}

static jint JNI_VideoTrack_GetContentHint(JNIEnv* jni,
jlong j_native_track) {
return (int)reinterpret_cast<VideoTrackInterface*>(j_native_track)->content_hint();
}
} // namespace jni
} // namespace webrtc
1 change: 1 addition & 0 deletions sdk/objc/api/peerconnection/RTCVideoTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ RTC_OBJC_EXPORT

/** The receive state, if this is a remote video track. */
@property(nonatomic, assign) BOOL shouldReceive;
@property(nonatomic, assign) int contentHint;

- (instancetype)init NS_UNAVAILABLE;

Expand Down
8 changes: 8 additions & 0 deletions sdk/objc/api/peerconnection/RTCVideoTrack.mm
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ - (void)setShouldReceive:(BOOL)shouldReceive {
self.nativeVideoTrack->set_should_receive(shouldReceive);
}

- (int)contentHint {
return (int)self.nativeVideoTrack->content_hint();
}

- (void)setContentHint:(int)val {
self.nativeVideoTrack->set_content_hint((webrtc::VideoTrackInterface::ContentHint)val);
}

- (void)addRenderer:(id<RTC_OBJC_TYPE(RTCVideoRenderer)>)renderer {
if (!_workerThread->IsCurrent()) {
_workerThread->BlockingCall([renderer, self] { [self addRenderer:renderer]; });
Expand Down