Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

obs-webrtc: Add WHEP Source #10353

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
39 changes: 36 additions & 3 deletions plugins/obs-webrtc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,48 @@ endif()

find_package(LibDataChannel 0.20 REQUIRED)
find_package(CURL REQUIRED)
find_package(
FFmpeg REQUIRED
COMPONENTS avcodec
avfilter
avdevice
avutil
swscale
avformat
swresample)

if(NOT TARGET OBS::media-playback)
add_subdirectory("${CMAKE_SOURCE_DIR}/deps/media-playback" "${CMAKE_BINARY_DIR}/deps/media-playback")
endif()

add_library(obs-webrtc MODULE)
add_library(OBS::webrtc ALIAS obs-webrtc)

target_sources(
obs-webrtc PRIVATE # cmake-format: sortable
obs-webrtc.cpp whip-output.cpp whip-output.h whip-service.cpp whip-service.h whip-utils.h)
obs-webrtc
PRIVATE # cmake-format: sortable
obs-webrtc.cpp
webrtc-utils.h
whep-source.cpp
whep-source.h
whip-output.cpp
whip-output.h
whip-service.cpp
whip-service.h)

target_link_libraries(obs-webrtc PRIVATE OBS::libobs LibDataChannel::LibDataChannel CURL::libcurl)
target_link_libraries(
obs-webrtc
PRIVATE OBS::libobs
OBS::media-playback
LibDataChannel::LibDataChannel
CURL::libcurl
FFmpeg::avcodec
FFmpeg::avfilter
FFmpeg::avformat
FFmpeg::avdevice
FFmpeg::avutil
FFmpeg::swscale
FFmpeg::swresample)

# cmake-format: off
set_target_properties_obs(obs-webrtc PROPERTIES FOLDER plugins PREFIX "")
Expand Down
38 changes: 35 additions & 3 deletions plugins/obs-webrtc/cmake/legacy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,46 @@ endif()

find_package(LibDataChannel 0.20 REQUIRED)
find_package(CURL REQUIRED)
find_package(
FFmpeg REQUIRED
COMPONENTS avcodec
avfilter
avdevice
avutil
swscale
avformat
swresample)
if(NOT TARGET OBS::media-playback)
add_subdirectory("${CMAKE_SOURCE_DIR}/deps/media-playback" "${CMAKE_BINARY_DIR}/deps/media-playback")
endif()

add_library(obs-webrtc MODULE)
add_library(OBS::webrtc ALIAS obs-webrtc)

target_sources(obs-webrtc PRIVATE obs-webrtc.cpp whip-output.cpp whip-output.h whip-service.cpp whip-service.h
whip-utils.h)
target_sources(
obs-webrtc
PRIVATE obs-webrtc.cpp
whip-output.cpp
whip-output.h
whip-service.cpp
whip-service.h
whep-source.cpp
whep-source.h
webrtc-utils.h)

target_link_libraries(obs-webrtc PRIVATE OBS::libobs LibDataChannel::LibDataChannel CURL::libcurl)
target_link_libraries(
obs-webrtc
PRIVATE OBS::libobs
OBS::media-playback
LibDataChannel::LibDataChannel
CURL::libcurl
FFmpeg::avcodec
FFmpeg::avfilter
FFmpeg::avformat
FFmpeg::avdevice
FFmpeg::avutil
FFmpeg::swscale
FFmpeg::swresample)

set_target_properties(obs-webrtc PROPERTIES FOLDER "plugins")

Expand Down
1 change: 1 addition & 0 deletions plugins/obs-webrtc/data/locale/en-US.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Output.Name="WHIP Output"
Source.Name="WHEP Source"
Service.Name="WHIP Service"
Service.BearerToken="Bearer Token"

Expand Down
2 changes: 2 additions & 0 deletions plugins/obs-webrtc/obs-webrtc.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <obs-module.h>

#include "whip-output.h"
#include "whep-source.h"
#include "whip-service.h"

OBS_DECLARE_MODULE()
Expand All @@ -14,6 +15,7 @@ bool obs_module_load()
{
register_whip_output();
register_whip_service();
register_whep_source();

return true;
}
Loading
Loading