-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
obs-outputs: Adds AV1, HEVC via RTMP to YouTube.
Implements Enhanced RTMP spec at https://github.com/veovera/enhanced-rtmp, specifically adding AV1 and HEVC support, and enabling streaming to YouTube. Note that this feature is in beta at YouTube. Additionally adds flag-guarded HDR metadata frame support, according to the spec.
- Loading branch information
1 parent
ddee7ff
commit 629bf6b
Showing
20 changed files
with
2,260 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#pragma once | ||
|
||
#if defined(__GNUC__) || defined(__clang__) | ||
|
||
#define clz32(x) __builtin_clz(x) | ||
#define ctz32(x) __builtin_ctz(x) | ||
|
||
#elif defined(_MSC_VER) && _MSC_VER >= 1400 | ||
|
||
static inline int clz32(unsigned long val) | ||
{ | ||
uint32_t zeros = 0; | ||
_BitScanReverse(&zeros, val); | ||
return 31 - zeros; | ||
} | ||
static inline int ctz32(unsigned long val) | ||
{ | ||
uint32_t zeros = 0; | ||
_BitScanForward(&zeros, val); | ||
return zeros; | ||
} | ||
|
||
#else | ||
|
||
static uint32_t popcnt(uint32_t x) | ||
{ | ||
x -= ((x >> 1) & 0x55555555); | ||
x = (((x >> 2) & 0x33333333) + (x & 0x33333333)); | ||
x = (((x >> 4) + x) & 0x0f0f0f0f); | ||
x += (x >> 8); | ||
x += (x >> 16); | ||
return x & 0x0000003f; | ||
} | ||
static uint32_t clz32(uint32_t x) | ||
{ | ||
x |= (x >> 1); | ||
x |= (x >> 2); | ||
x |= (x >> 4); | ||
x |= (x >> 8); | ||
x |= (x >> 16); | ||
return 32 - popcnt(x); | ||
} | ||
static uint32_t ctz32(uint32_t x) | ||
{ | ||
return popcnt((x & -x) - 1); | ||
} | ||
|
||
#endif | ||
|
||
#ifdef MIN | ||
#undef MIN | ||
#endif | ||
static inline int MIN(int x, int y) | ||
{ | ||
return x < y ? x : y; | ||
} | ||
|
||
#ifdef MAX | ||
#undef MAX | ||
#endif | ||
static inline int MAX(int x, int y) | ||
{ | ||
return x > y ? x : y; | ||
} | ||
|
||
static inline uint32_t RB32(const uint8_t *ptr) | ||
{ | ||
return (ptr[0] << 24) + (ptr[1] << 16) + (ptr[2] << 8) + ptr[3]; | ||
} | ||
|
||
static inline uint32_t av_bswap32(uint32_t x) | ||
{ | ||
return (((x << 8) & 0xff00) | ((x >> 8) & 0x00ff)); | ||
} | ||
static inline uint64_t av_bswap64(uint64_t x) | ||
{ | ||
return ((uint64_t)av_bswap32((uint32_t)x) << 32) | | ||
av_bswap32((uint32_t)(x >> 32)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.