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

refactor qvs saveas parameter #153

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions qvs/record.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (manager *Manager) DeleteStreamRecordHistories(nsId, streamId string, files
return manager.client.CallWithJson(context.Background(), nil, "DELETE", manager.url("/namespaces/%s/streams/%s/recordhistories", nsId, streamId), nil, M{"files": files})
}

type saveasArgs struct {
type SaveasArgs struct {
Fname string `json:"fname"`
Format string `json:"format"`
Start int `json:"start"`
Expand All @@ -30,16 +30,16 @@ type saveasArgs struct {
DeleteAfterDays int `json:"deleteAfterDays"`
}

type saveasReply struct {
type SaveasReply struct {
Fname string `json:"fname"`
PersistenId string `json:"persistentId,omitempty"`
Bucket string `json:"bucket"`
Duration int `json:"duration"` // ms
}

// 录制视频片段合并
func (manager *Manager) RecordClipsSaveas(nsId, streamId string, arg *saveasArgs) (*saveasReply, error) {
var ret saveasReply
func (manager *Manager) RecordClipsSaveas(nsId, streamId string, arg *SaveasArgs) (*SaveasReply, error) {
var ret SaveasReply
err := manager.client.CallWithJson(context.Background(), &ret, "POST", manager.url("/namespaces/%s/streams/%s/saveas", nsId, streamId), nil, arg)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion qvs/record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestRecordClipsSaveasAndDeleteRecord(t *testing.T) {
}
c := getTestManager()

ret, err := c.RecordClipsSaveas("2xenzw5o81ods", "31011500991320000356", &saveasArgs{
ret, err := c.RecordClipsSaveas("2xenzw5o81ods", "31011500991320000356", &SaveasArgs{
Format: "m3u8",
Start: 1604989846,
End: 1604990735,
Expand Down
Loading