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

For #1637, #307, support webrtc playback. #1638

Merged
merged 79 commits into from
Mar 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
7c8a35a
use libco instead of state-thread(st), still have some bug
xiaozhihong Feb 16, 2020
1c74083
Revert "use libco instead of state-thread(st), still have some bug"
xiaozhihong Feb 17, 2020
2b299a8
Merge branch 'develop' of https://github.com/ossrs/srs into develop
xiaozhihong Feb 17, 2020
7c27037
Merge branch 'develop' of https://github.com/ossrs/srs into develop
xiaozhihong Feb 17, 2020
3ce5f6c
Merge branch 'develop' of https://github.com/ossrs/srs into develop
xiaozhihong Feb 19, 2020
bc22ebe
add rtc http request and response, exchange sdp.
xiaozhihong Feb 21, 2020
51abb08
rtp session manager, stun codding
xiaozhihong Feb 23, 2020
62563bd
rtc framework
xiaozhihong Feb 28, 2020
30d8b22
parse sdp
xiaozhihong Mar 2, 2020
9d5495c
"stun and dtls done"
xiaozhihong Mar 6, 2020
936ba75
modify depend.sh
xiaozhihong Mar 6, 2020
a36ed69
add rtc.html temp
xiaozhihong Mar 6, 2020
b730458
add candidates ip list, add rtc_upload.html to test
Mar 7, 2020
c62901a
make code easy, wrap udp remux socket
xiaozhihong Mar 7, 2020
2e68c37
start coding flv->rtp
Mar 8, 2020
2f46277
rtp support
xiaozhihong Mar 8, 2020
3ae510b
rtp dispatch done, but video can not play in chrome
Mar 9, 2020
e267510
fix rtp h264 packet bug
xiaozhihong Mar 9, 2020
ff0e038
h264 rtp debuging
Mar 10, 2020
e831f32
some code
xiaozhihong Mar 10, 2020
da72caf
h264 packet done, chrome play well
Mar 11, 2020
6decdc7
adjust code style, fix some bug, add rtc session timeout
xiaozhihong Mar 12, 2020
027d34b
add rtp shared packet
xiaozhihong Mar 13, 2020
768598a
add kernel rtp packet
xiaozhihong Mar 13, 2020
d21ef10
Merge branch 'rtc' of https://github.com/xiaozhihong/srs into xiaozhi…
winlinvip Mar 13, 2020
6c88f58
remove debug code, fix rtc.html
xiaozhihong Mar 13, 2020
51af2b4
For #1638, #307, rtc conf support ENV.
winlinvip Mar 14, 2020
6f4584d
Merge SRS4
winlinvip Mar 14, 2020
a42cf3a
For #1638, #307, refactor rtc config.
winlinvip Mar 14, 2020
12e99f1
For #1638, #307, use webrtc adapter.js for demo.
winlinvip Mar 14, 2020
2b56f9e
add NACK suport, remove debug code, verbose log
xiaozhihong Mar 14, 2020
c2916ac
For #1638, #307, define webrtc:// url for play
winlinvip Mar 14, 2020
60c8b37
For #1638, #307, merge john, add NACK suport, remove debug code, verb…
winlinvip Mar 14, 2020
4b23d04
For #1638, #307, fix rtc player demo bug
winlinvip Mar 14, 2020
9e856c8
For #1638, #307, remove unused bash variable.
winlinvip Mar 15, 2020
e905fce
For #1638, #307, add comments in RTMP/RTP message for RTC.
winlinvip Mar 16, 2020
2f0b150
For #1638, #307, accept srs_string_dumps_hex to app utility.
winlinvip Mar 16, 2020
c2a667c
For #1638, #307, add comments for api and enum
winlinvip Mar 16, 2020
e8b2bb5
process err, do error check, add some error code
Mar 16, 2020
b5dd502
For #1638, #307, fix build warnings
winlinvip Mar 17, 2020
6118ca3
For #1638, #307, http api success with message, timeout as such
winlinvip Mar 17, 2020
29b9203
For #1638, #307, use short-term http connection for rtc to use new cid.
winlinvip Mar 17, 2020
25fec76
For #1638, #307, switch to RTC session context cid for reusing UDP ports
winlinvip Mar 17, 2020
4318d98
For #1638, #307, switch to RTC session context cid for cleanup
winlinvip Mar 17, 2020
2c4dc0f
For #1638, #307, extract rtc server to hybrid manager.
winlinvip Mar 17, 2020
ed29961
For #1638, #307, refine api and udp for rtc.
winlinvip Mar 17, 2020
0ff8a37
For #1638, #307, should check error by fetch_or_create source
winlinvip Mar 17, 2020
28c1c57
For #1638, #307, should set err in return value.
winlinvip Mar 17, 2020
fc84f1e
Refactor source cid with pid
winlinvip Mar 17, 2020
e223302
fix h264 rtp packet error
xiaozhihong Mar 18, 2020
c210c0b
For #1638, #307, refactor rtc player.
winlinvip Mar 18, 2020
979d7c3
For #1638, #307, refactor rtc player.
winlinvip Mar 18, 2020
018577e
For #1638, #307, fix error new bug for rtc
winlinvip Mar 18, 2020
0b6e925
For #1638, #307, remove unused code for rtc
winlinvip Mar 18, 2020
d1d16d4
Detect B frame in avc stream. Fix compiler error with verbose
Mar 18, 2020
94e4f45
merge feature/rtc, fix conflict
Mar 18, 2020
830e60d
For #1638, #307, update authors for rtc
winlinvip Mar 19, 2020
8eef439
For #1638, #307, use hourglass for timer.
winlinvip Mar 19, 2020
8815068
Update
winlinvip Mar 20, 2020
532750f
Refactor api data, url to api
winlinvip Mar 21, 2020
3360db7
Refactor api, follow https://github.com/rtcdn/rtcdn-draft
winlinvip Mar 21, 2020
61b8ae8
Refactor api, follow https://github.com/rtcdn/rtcdn-draft
winlinvip Mar 21, 2020
d203645
Refactor api, follow https://github.com/rtcdn/rtcdn-draft
winlinvip Mar 21, 2020
3f6a287
For #1638, #307, show error information when api failed.
winlinvip Mar 21, 2020
68ad006
Remove empty line.
winlinvip Mar 21, 2020
fa700da
1. Modify rtc.conf to support Bframe discard.
xiaozhihong Mar 21, 2020
7315b1a
Fix config read "bframe" discad bug.
xiaozhihong Mar 21, 2020
a0a4337
make webrtc audio work
Mar 21, 2020
0cd67a9
For #1638, #307, add comments for vhost rtc config
winlinvip Mar 21, 2020
2757ec7
Merge from bepartofyou
winlinvip Mar 21, 2020
e1fe2d1
For #1638, #307, add comments for audio codec
winlinvip Mar 21, 2020
2da4e0a
For #1638, #307, config to discard aac for rtc
winlinvip Mar 22, 2020
634a14b
For #1659, #307, add opus codec library
winlinvip Mar 22, 2020
4308f23
For #1659, #307, add ffmpeg-4.2-fit for rtc
winlinvip Mar 22, 2020
734e848
Update RtcSession peer address when changed.
xiaozhihong Mar 22, 2020
37c84ec
For #1659, #307, add x86 asm for ffmpeg for rtc
winlinvip Mar 22, 2020
602a478
For #1659, #307, add switch to disable rtc
winlinvip Mar 22, 2020
a912f04
Merge branch 'feature/ffmpeg' into feature/codec
winlinvip Mar 22, 2020
c00ffa5
Merge branch 'feature/codec' into feature/rtc
winlinvip Mar 22, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
- image: ossrs/srs:dev
steps:
- checkout
- run: cd trunk && ./configure && make
- run: cd trunk && ./configure --without-rtc && make && ./configure && make
test:
docker:
- image: ossrs/srs:dev
Expand Down
5 changes: 4 additions & 1 deletion AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,7 @@ CONTRIBUTORS ordered by first contribution.
* lam2003<linmin3@yy.com>
* runner365<shi.weibd@hotmail.com>
* XiaofengWang<wasphin@gmail.com>
* XiaLixin<xialx@yuntongxun.com>
* XiaLixin<xialx@yuntongxun.com>
* xiaozhihong<xiaozhihong8@gmail.com>
* HuyaJohn<xiaozhihong@huya.com>

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,7 @@ Winlin

[bug #1631]: https://github.com/ossrs/srs/issues/1631
[bug #1612]: https://github.com/ossrs/srs/issues/1612
[bug #1636]: https://github.com/ossrs/srs/issues/1636
[bug #zzzzzzzzzzzzz]: https://github.com/ossrs/srs/issues/zzzzzzzzzzzzz

[exo #828]: https://github.com/google/ExoPlayer/pull/828
Expand Down
18 changes: 18 additions & 0 deletions trunk/3rdparty/ffmpeg-4.2-fit/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Ignore files.
*.d
*.pc
*.o
config.asm
config.h
_release
doc
ffbuild/config.fate
ffbuild/config.log
ffbuild/config.mak
ffbuild/config.sh
ffbuild/.config
libavutil/lib.version
libavcodec/libavcodec.version
libavutil/libavutil.version
libswresample/libswresample.version
libavutil/ffversion.h
Empty file.
169 changes: 169 additions & 0 deletions trunk/3rdparty/ffmpeg-4.2-fit/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
MAIN_MAKEFILE=1
include ffbuild/config.mak

vpath %.c $(SRC_PATH)
vpath %.cpp $(SRC_PATH)
vpath %.h $(SRC_PATH)
vpath %.inc $(SRC_PATH)
vpath %.m $(SRC_PATH)
vpath %.S $(SRC_PATH)
vpath %.asm $(SRC_PATH)
vpath %.rc $(SRC_PATH)
vpath %.v $(SRC_PATH)
vpath %.texi $(SRC_PATH)
vpath %.cu $(SRC_PATH)
vpath %.ptx $(SRC_PATH)
vpath %/fate_config.sh.template $(SRC_PATH)

TESTTOOLS = audiogen videogen rotozoom tiny_psnr tiny_ssim base64 audiomatch
HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options

# $(FFLIBS-yes) needs to be in linking order
FFLIBS-$(CONFIG_AVDEVICE) += avdevice
FFLIBS-$(CONFIG_AVFILTER) += avfilter
FFLIBS-$(CONFIG_AVFORMAT) += avformat
FFLIBS-$(CONFIG_AVCODEC) += avcodec
FFLIBS-$(CONFIG_AVRESAMPLE) += avresample
FFLIBS-$(CONFIG_POSTPROC) += postproc
FFLIBS-$(CONFIG_SWRESAMPLE) += swresample
FFLIBS-$(CONFIG_SWSCALE) += swscale

FFLIBS := avutil

DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd

SKIPHEADERS = compat/w32pthreads.h

# first so "all" becomes default target
all: all-yes

include $(SRC_PATH)/ffbuild/common.mak

FF_EXTRALIBS := $(FFEXTRALIBS)
FF_DEP_LIBS := $(DEP_LIBS)
FF_STATIC_DEP_LIBS := $(STATIC_DEP_LIBS)

$(TOOLS): %$(EXESUF): %.o
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(EXTRALIBS-$(*F)) $(EXTRALIBS) $(ELIBS)

target_dec_%_fuzzer$(EXESUF): target_dec_%_fuzzer.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)

tools/target_dem_fuzzer$(EXESUF): tools/target_dem_fuzzer.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)

tools/sofa2wavs$(EXESUF): ELIBS = $(FF_EXTRALIBS)
tools/uncoded_frame$(EXESUF): $(FF_DEP_LIBS)
tools/uncoded_frame$(EXESUF): ELIBS = $(FF_EXTRALIBS)
tools/target_dec_%_fuzzer$(EXESUF): $(FF_DEP_LIBS)

CONFIGURABLE_COMPONENTS = \
$(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c)) \
$(SRC_PATH)/libavcodec/bitstream_filters.c \
$(SRC_PATH)/libavcodec/parsers.c \
$(SRC_PATH)/libavformat/protocols.c \

config.h: ffbuild/.config
ffbuild/.config: $(CONFIGURABLE_COMPONENTS)
@-tput bold 2>/dev/null
@-printf '\nWARNING: $(?) newer than config.h, rerun configure\n\n'
@-tput sgr0 2>/dev/null

SUBDIR_VARS := CLEANFILES FFLIBS HOSTPROGS TESTPROGS TOOLS \
HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
ALTIVEC-OBJS VSX-OBJS MMX-OBJS X86ASM-OBJS \
MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSP-OBJS MSA-OBJS \
MMI-OBJS OBJS SLIBOBJS HOSTOBJS TESTOBJS

define RESET
$(1) :=
$(1)-yes :=
endef

define DOSUBDIR
$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
SUBDIR := $(1)/
include $(SRC_PATH)/$(1)/Makefile
-include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
-include $(SRC_PATH)/$(1)/$(INTRINSICS)/Makefile
include $(SRC_PATH)/ffbuild/library.mak
endef

$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))

libavcodec/utils.o libavformat/utils.o libavdevice/avdevice.o libavfilter/avfilter.o libavutil/utils.o libpostproc/postprocess.o libswresample/swresample.o libswscale/utils.o : libavutil/ffversion.h

$(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
ifeq ($(STRIPTYPE),direct)
$(STRIP) -o $@ $<
else
$(CP) $< $@
$(STRIP) $@
endif

%$(PROGSSUF)_g$(EXESUF): $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)

VERSION_SH = $(SRC_PATH)/ffbuild/version.sh
GIT_LOG = $(SRC_PATH)/.git/logs/HEAD

.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) ffbuild/config.mak
.version: M=@

libavutil/ffversion.h .version:
$(M)$(VERSION_SH) $(SRC_PATH) libavutil/ffversion.h $(EXTRA_VERSION)
$(Q)touch .version

# force version.sh to run whenever version might have changed
-include .version

install: install-libs install-headers

install-libs: install-libs-yes

install-data: $(DATA_FILES)
$(Q)mkdir -p "$(DATADIR)"
$(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"

uninstall: uninstall-data uninstall-headers uninstall-libs uninstall-pkgconfig

uninstall-data:
$(RM) -r "$(DATADIR)"

clean::
$(RM) $(CLEANSUFFIXES)
$(RM) $(addprefix compat/,$(CLEANSUFFIXES)) $(addprefix compat/*/,$(CLEANSUFFIXES)) $(addprefix compat/*/*/,$(CLEANSUFFIXES))
$(RM) -r coverage-html
$(RM) -rf coverage.info coverage.info.in lcov

distclean:: clean
$(RM) .version avversion.h config.asm config.h mapfile \
ffbuild/.config ffbuild/config.* libavutil/avconfig.h \
version.h libavutil/ffversion.h libavcodec/codec_names.h \
libavcodec/bsf_list.c libavformat/protocol_list.c \
libavcodec/codec_list.c libavcodec/parser_list.c \
libavformat/muxer_list.c libavformat/demuxer_list.c
ifeq ($(SRC_LINK),src)
$(RM) src
endif

config:
$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)

build: all alltools testprogs
check: all alltools testprogs fate

$(sort $(OUTDIRS)):
$(Q)mkdir -p $@

# Dummy rule to stop make trying to rebuild removed or renamed headers
%.h:
@:

# Disable suffix rules. Most of the builtin rules are suffix rules,
# so this saves some time on slow systems.
.SUFFIXES:

.PHONY: all all-yes alltools build check config testprogs
.PHONY: *clean install* uninstall*
173 changes: 173 additions & 0 deletions trunk/3rdparty/ffmpeg-4.2-fit/compat/atomics/gcc/stdatomic.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

/*
* based on vlc_atomic.h from VLC
* Copyright (C) 2010 Rémi Denis-Courmont
*/

#ifndef COMPAT_ATOMICS_GCC_STDATOMIC_H
#define COMPAT_ATOMICS_GCC_STDATOMIC_H

#include <stddef.h>
#include <stdint.h>

#define ATOMIC_FLAG_INIT 0

#define ATOMIC_VAR_INIT(value) (value)

#define atomic_init(obj, value) \
do { \
*(obj) = (value); \
} while(0)

#define kill_dependency(y) ((void)0)

#define atomic_thread_fence(order) \
__sync_synchronize()

#define atomic_signal_fence(order) \
((void)0)

#define atomic_is_lock_free(obj) 0

typedef _Bool atomic_flag;
typedef _Bool atomic_bool;
typedef char atomic_char;
typedef signed char atomic_schar;
typedef unsigned char atomic_uchar;
typedef short atomic_short;
typedef unsigned short atomic_ushort;
typedef int atomic_int;
typedef unsigned int atomic_uint;
typedef long atomic_long;
typedef unsigned long atomic_ulong;
typedef long long atomic_llong;
typedef unsigned long long atomic_ullong;
typedef wchar_t atomic_wchar_t;
typedef int_least8_t atomic_int_least8_t;
typedef uint_least8_t atomic_uint_least8_t;
typedef int_least16_t atomic_int_least16_t;
typedef uint_least16_t atomic_uint_least16_t;
typedef int_least32_t atomic_int_least32_t;
typedef uint_least32_t atomic_uint_least32_t;
typedef int_least64_t atomic_int_least64_t;
typedef uint_least64_t atomic_uint_least64_t;
typedef int_fast8_t atomic_int_fast8_t;
typedef uint_fast8_t atomic_uint_fast8_t;
typedef int_fast16_t atomic_int_fast16_t;
typedef uint_fast16_t atomic_uint_fast16_t;
typedef int_fast32_t atomic_int_fast32_t;
typedef uint_fast32_t atomic_uint_fast32_t;
typedef int_fast64_t atomic_int_fast64_t;
typedef uint_fast64_t atomic_uint_fast64_t;
typedef intptr_t atomic_intptr_t;
typedef uintptr_t atomic_uintptr_t;
typedef size_t atomic_size_t;
typedef ptrdiff_t atomic_ptrdiff_t;
typedef intmax_t atomic_intmax_t;
typedef uintmax_t atomic_uintmax_t;

#define atomic_store(object, desired) \
do { \
*(object) = (desired); \
__sync_synchronize(); \
} while (0)

#define atomic_store_explicit(object, desired, order) \
atomic_store(object, desired)

#define atomic_load(object) \
(__sync_synchronize(), *(object))

#define atomic_load_explicit(object, order) \
atomic_load(object)

#define atomic_exchange(object, desired) \
({ \
__typeof__(object) _obj = (object); \
__typeof__(*object) _old; \
do \
_old = atomic_load(_obj); \
while (!__sync_bool_compare_and_swap(_obj, _old, (desired))); \
_old; \
})

#define atomic_exchange_explicit(object, desired, order) \
atomic_exchange(object, desired)

#define atomic_compare_exchange_strong(object, expected, desired) \
({ \
__typeof__(object) _exp = (expected); \
__typeof__(*object) _old = *_exp; \
*_exp = __sync_val_compare_and_swap((object), _old, (desired)); \
*_exp == _old; \
})

#define atomic_compare_exchange_strong_explicit(object, expected, desired, success, failure) \
atomic_compare_exchange_strong(object, expected, desired)

#define atomic_compare_exchange_weak(object, expected, desired) \
atomic_compare_exchange_strong(object, expected, desired)

#define atomic_compare_exchange_weak_explicit(object, expected, desired, success, failure) \
atomic_compare_exchange_weak(object, expected, desired)

#define atomic_fetch_add(object, operand) \
__sync_fetch_and_add(object, operand)

#define atomic_fetch_add_explicit(object, operand, order) \
atomic_fetch_add(object, operand)

#define atomic_fetch_sub(object, operand) \
__sync_fetch_and_sub(object, operand)

#define atomic_fetch_sub_explicit(object, operand, order) \
atomic_fetch_sub(object, operand)

#define atomic_fetch_or(object, operand) \
__sync_fetch_and_or(object, operand)

#define atomic_fetch_or_explicit(object, operand, order) \
atomic_fetch_or(object, operand)

#define atomic_fetch_xor(object, operand) \
__sync_fetch_and_xor(object, operand)

#define atomic_fetch_xor_explicit(object, operand, order) \
atomic_fetch_xor(object, operand)

#define atomic_fetch_and(object, operand) \
__sync_fetch_and_and(object, operand)

#define atomic_fetch_and_explicit(object, operand, order) \
atomic_fetch_and(object, operand)

#define atomic_flag_test_and_set(object) \
atomic_exchange(object, 1)

#define atomic_flag_test_and_set_explicit(object, order) \
atomic_flag_test_and_set(object)

#define atomic_flag_clear(object) \
atomic_store(object, 0)

#define atomic_flag_clear_explicit(object, order) \
atomic_flag_clear(object)

#endif /* COMPAT_ATOMICS_GCC_STDATOMIC_H */
Loading