This repository has been archived by the owner on Sep 12, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09b8387
commit 578c4fa
Showing
6 changed files
with
48 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,5 @@ _testmain.go | |
*.coverprofile | ||
coverage.txt | ||
.DS_Store | ||
|
||
snickers |
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,20 @@ | ||
package encoders | ||
|
||
import ( | ||
"code.cloudfoundry.org/lager" | ||
"github.com/snickers/snickers/db" | ||
"github.com/snickers/snickers/types" | ||
) | ||
|
||
// EncodeFunc is a function type for the multiple | ||
// possible ways to encode the job | ||
type EncodeFunc func(logger lager.Logger, dbInstance db.Storage, jobID string) error | ||
|
||
// GetEncodeFunc returns the encode function | ||
// based on the job source. | ||
func GetEncodeFunc(job types.Job) EncodeFunc { | ||
if job.ABR { | ||
return HLSEncode | ||
} | ||
return FFMPEGEncode | ||
} |
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,19 @@ | ||
package encoders | ||
|
||
import ( | ||
"code.cloudfoundry.org/lager" | ||
"github.com/snickers/hls/segmenter" | ||
"github.com/snickers/snickers/db" | ||
) | ||
|
||
// HLSEncode function is responsible for encoding adaptive bitrate outputs | ||
func HLSEncode(logger lager.Logger, dbInstance db.Storage, jobID string) error { | ||
log := logger.Session("hls-encode") | ||
log.Info("started", lager.Data{"job": jobID}) | ||
defer log.Info("finished") | ||
var cfg segmenter.HLSConfig | ||
if cfg.SourceFile == "" { | ||
return nil | ||
} | ||
return nil | ||
} |
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