Refactored samplebuilder logic

Many corner cases would cause samplebuilder to fail and return invalid
results. This refactoring is more reliable in all cases.

Fixed bug in H264 writer by reusing the packet object in  H264 writer.
This commit is contained in:
Robin Raymond
2021-05-06 14:57:25 -04:00
parent 6af391480a
commit 7d97c9b5d3
11 changed files with 516 additions and 198 deletions

View File

@@ -14,8 +14,7 @@ import (
// customLogger satisfies the interface logging.LeveledLogger
// a logger is created per subsystem in Pion, so you can have custom
// behavior per subsystem (ICE, DTLS, SCTP...)
type customLogger struct {
}
type customLogger struct{}
// Print all messages except trace
func (c customLogger) Trace(msg string) {}
@@ -41,8 +40,7 @@ func (c customLogger) Errorf(format string, args ...interface{}) {
// customLoggerFactory satisfies the interface logging.LoggerFactory
// This allows us to create different loggers per subsystem. So we can
// add custom behavior
type customLoggerFactory struct {
}
type customLoggerFactory struct{}
func (c customLoggerFactory) NewLogger(subsystem string) logging.LeveledLogger {
fmt.Printf("Creating logger for %s \n", subsystem)