Skip to content

Commit

Permalink
Remove File Transcode endpoint (#511)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomshutt authored Mar 8, 2023
1 parent fe99ad4 commit ac180e7
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 242 deletions.
12 changes: 0 additions & 12 deletions api/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,6 @@ func NewCatalystAPIRouter(vodEngine *pipeline.Coordinator, apiToken string) *htt
),
)

router.POST("/api/transcode/file",
withLogging(
withAuth(
apiToken,
withCapacityChecking(
vodEngine,
catalystApiHandlers.TranscodeSegment(),
),
),
),
)

// Endpoint to receive "Triggers" (callbacks) from Mist
router.POST("/api/mist/trigger", withLogging(mistCallbackHandlers.Trigger()))

Expand Down
87 changes: 0 additions & 87 deletions handlers/handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,93 +42,6 @@ func TestOKHandler(t *testing.T) {
require.Equal(rr.Body.String(), "OK")
}

func TestSegmentBodyFormat(t *testing.T) {
require := require.New(t)

badRequests := [][]byte{
// missing source_location
[]byte(`{
"callback_url": "http://localhost:8080/callback",
"manifestID": "somestream",
"profiles": [{"name": "t","width": 1280,"height": 720,"bitrate": 70000,"fps": 30}],
"verificationFreq": 1
}`),
// missing callback_url
[]byte(`{
"source_location": "http://localhost/input",
"manifestID": "somestream",
"profiles": [{"name": "t","width": 1280,"height": 720,"bitrate": 70000,"fps": 30}],
"verificationFreq": 1
}`),
// missing manifestID
[]byte(`{
"source_location": "http://localhost/input",
"callback_url": "http://localhost:8080/callback",
"profiles": [{"name": "t","width": 1280,"height": 720,"bitrate": 70000,"fps": 30}],
"verificationFreq": 1
}`),
// missing profiles
[]byte(`{
"source_location": "http://localhost/input",
"callback_url": "http://localhost:8080/callback",
"manifestID": "somestream",
"verificationFreq": 1
}`),
// missing name
[]byte(`{
"source_location": "http://localhost/input",
"callback_url": "http://localhost:8080/callback",
"manifestID": "somestream",
"profiles": [{"width": 1280,"height": 720,"bitrate": 70000,"fps": 30}],
"verificationFreq": 1
}`),
// missing width
[]byte(`{
"source_location": "http://localhost/input",
"callback_url": "http://localhost:8080/callback",
"manifestID": "somestream",
"profiles": [{"name": "t","height": 720,"bitrate": 70000,"fps": 30}],
"verificationFreq": 1
}`),
// missing height
[]byte(`{
"source_location": "http://localhost/input",
"callback_url": "http://localhost:8080/callback",
"manifestID": "somestream",
"profiles": [{"name": "t","width": 1280,"bitrate": 70000,"fps": 30}],
"verificationFreq": 1
}`),
// missing bitrate
[]byte(`{
"source_location": "http://localhost/input",
"callback_url": "http://localhost:8080/callback",
"manifestID": "somestream",
"profiles": [{"name": "t","width": 1280,"height": 720,"fps": 30}],
"verificationFreq": 1
}`),
// missing verificationFreq
[]byte(`{
"source_location": "http://localhost/input",
"callback_url": "http://localhost:8080/callback",
"manifestID": "somestream",
"profiles": [{"name": "t","width": 1280,"height": 720,"bitrate": 70000,"fps": 30}]
}`),
}

catalystApiHandlers := CatalystAPIHandlersCollection{VODEngine: pipeline.NewStubCoordinator()}
router := httprouter.New()

router.POST("/api/transcode/file", catalystApiHandlers.TranscodeSegment())
for _, payload := range badRequests {
req, _ := http.NewRequest("POST", "/api/transcode/file", bytes.NewBuffer(payload))
req.Header.Set("Content-Type", "application/json")

rr := httptest.NewRecorder()
router.ServeHTTP(rr, req)
require.Equal(400, rr.Result().StatusCode, string(payload))
}
}

func TestVODHandlerProfiles(t *testing.T) {
// Create temporary manifest + segment files on the local filesystem
inputUrl, outputUrl := createTempManifests(t)
Expand Down
97 changes: 0 additions & 97 deletions handlers/schemas/TranscodeSegment.yaml

This file was deleted.

46 changes: 0 additions & 46 deletions handlers/transcode.go

This file was deleted.

0 comments on commit ac180e7

Please sign in to comment.