mirror of
https://github.com/qrtc/ffmpeg-dev-go.git
synced 2025-10-05 07:37:20 +08:00
2023-10-29 08:11:29 CST W44D0
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ffmpeg_hw_d3d11va
|
||||
|
||||
package ffmpeg
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ffmpeg_hw_dvxa2
|
||||
|
||||
package ffmpeg
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ffmpeg_hw_mediacodec
|
||||
|
||||
package ffmpeg
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ffmpeg_hw_qsv
|
||||
|
||||
package ffmpeg
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ffmpeg_hw_vaapi
|
||||
|
||||
package ffmpeg
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ffmpeg_hw_vdpau
|
||||
|
||||
package ffmpeg
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ffmpeg_hw_videotoolbox
|
||||
|
||||
package ffmpeg
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ffmpeg_hw_xvmc
|
||||
|
||||
package ffmpeg
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
18
avutil.go
18
avutil.go
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
@@ -88,8 +92,18 @@ func AvGetPictureTypeChar(pictType AVPictureType) string {
|
||||
}
|
||||
|
||||
// AvXIfNull returns x default pointer in case p is NULL.
|
||||
func AvXIfNull(p, x unsafe.Pointer) unsafe.Pointer {
|
||||
return C.av_x_if_null(p, x)
|
||||
func AvXIfNull[T any](p, x *T) *T {
|
||||
if p != nil {
|
||||
return p
|
||||
}
|
||||
return x
|
||||
}
|
||||
|
||||
func AvStringIfNull(p, x string) string {
|
||||
if len(p) != 0 {
|
||||
return p
|
||||
}
|
||||
return x
|
||||
}
|
||||
|
||||
// AvIntListLengthForSize computes the length of an integer list.
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ffmpeg_hw_cuda
|
||||
|
||||
package ffmpeg
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ffmpeg_hw_d3d11va
|
||||
|
||||
package ffmpeg
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ffmpeg_hw_drm
|
||||
|
||||
package ffmpeg
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ffmpeg_hw_dxva2
|
||||
|
||||
package ffmpeg
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ffmpeg_hw_mediacodec
|
||||
|
||||
package ffmpeg
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ffmpeg_hw_opencl
|
||||
|
||||
package ffmpeg
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ffmpeg_hw_qsv
|
||||
|
||||
package ffmpeg
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ffmpeg_hw_vaapi
|
||||
|
||||
package ffmpeg
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ffmpeg_hw_vdpau
|
||||
|
||||
package ffmpeg
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ffmpeg_hw_videotoolbox
|
||||
|
||||
package ffmpeg
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ffmpeg_hw_vulkan
|
||||
|
||||
package ffmpeg
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
@@ -17,29 +21,29 @@ const (
|
||||
)
|
||||
|
||||
// AvGcd computes the greatest common divisor of two integer operands.
|
||||
func AvGcd(a, b int64) int64 {
|
||||
return (int64)(C.av_gcd((C.int64_t)(a), (C.int64_t)(b)))
|
||||
func AvGcd[T Integer](a, b T) T {
|
||||
return (T)(C.av_gcd((C.int64_t)(a), (C.int64_t)(b)))
|
||||
}
|
||||
|
||||
// AvRescale rescale a 64-bit integer with rounding to nearest.
|
||||
func AvRescale(a, b, c int64) int64 {
|
||||
return (int64)(C.av_rescale((C.int64_t)(a), (C.int64_t)(b), (C.int64_t)(c)))
|
||||
func AvRescale[T Integer](a, b, c T) T {
|
||||
return (T)(C.av_rescale((C.int64_t)(a), (C.int64_t)(b), (C.int64_t)(c)))
|
||||
}
|
||||
|
||||
// AvRescaleRnd rescales a 64-bit integer with specified rounding.
|
||||
func AvRescaleRnd(a, b, c int64, rnd AVRounding) int64 {
|
||||
return (int64)(C.av_rescale_rnd((C.int64_t)(a), (C.int64_t)(b), (C.int64_t)(c),
|
||||
func AvRescaleRnd[T Integer](a, b, c T, rnd AVRounding) T {
|
||||
return (T)(C.av_rescale_rnd((C.int64_t)(a), (C.int64_t)(b), (C.int64_t)(c),
|
||||
(C.enum_AVRounding)(rnd)))
|
||||
}
|
||||
|
||||
// AvRescaleQ rescales a 64-bit integer by 2 rational numbers.
|
||||
func AvRescaleQ(a int64, bq, cq AVRational) int64 {
|
||||
return (int64)(C.av_rescale_q((C.int64_t)(a), (C.struct_AVRational)(bq), (C.struct_AVRational)(cq)))
|
||||
func AvRescaleQ[T Integer](a T, bq, cq AVRational) T {
|
||||
return (T)(C.av_rescale_q((C.int64_t)(a), (C.struct_AVRational)(bq), (C.struct_AVRational)(cq)))
|
||||
}
|
||||
|
||||
// AvRescaleQRnd rescales a 64-bit integer by 2 rational numbers with specified rounding.
|
||||
func AvRescaleQRnd(a int64, bq, cq AVRational, rnd AVRounding) int64 {
|
||||
return (int64)(C.av_rescale_q_rnd((C.int64_t)(a), (C.struct_AVRational)(bq), (C.struct_AVRational)(cq),
|
||||
func AvRescaleQRnd[T Integer](a T, bq, cq AVRational, rnd AVRounding) T {
|
||||
return (T)(C.av_rescale_q_rnd((C.int64_t)(a), (C.struct_AVRational)(bq), (C.struct_AVRational)(cq),
|
||||
(C.enum_AVRounding)(rnd)))
|
||||
}
|
||||
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
@@ -522,77 +526,88 @@ func AvOptSet(obj CVoidPointer, name string, val string, searchFlags int32) int3
|
||||
defer nameFunc()
|
||||
valPtr, valFunc := StringCasting(val)
|
||||
defer valFunc()
|
||||
return (int32)(C.av_opt_set(VoidPointer(obj), (*C.char)(namePtr), (*C.char)(valPtr), (C.int)(searchFlags)))
|
||||
return (int32)(C.av_opt_set(VoidPointer(obj), (*C.char)(namePtr),
|
||||
(*C.char)(valPtr), (C.int)(searchFlags)))
|
||||
}
|
||||
|
||||
// AvOptSetInt
|
||||
func AvOptSetInt(obj CVoidPointer, name string, val int64, searchFlags int32) int32 {
|
||||
func AvOptSetInt[T Integer](obj CVoidPointer, name string, val T, searchFlags int32) int32 {
|
||||
namePtr, nameFunc := StringCasting(name)
|
||||
defer nameFunc()
|
||||
return (int32)(C.av_opt_set_int(VoidPointer(obj), (*C.char)(namePtr), (C.int64_t)(val), (C.int)(searchFlags)))
|
||||
return (int32)(C.av_opt_set_int(VoidPointer(obj), (*C.char)(namePtr),
|
||||
(C.int64_t)(val), (C.int)(searchFlags)))
|
||||
}
|
||||
|
||||
// AvOptSetDouble
|
||||
func AvOptSetDouble(obj CVoidPointer, name string, val float64, searchFlags int32) int32 {
|
||||
namePtr, nameFunc := StringCasting(name)
|
||||
defer nameFunc()
|
||||
return (int32)(C.av_opt_set_double(VoidPointer(obj), (*C.char)(namePtr), (C.double)(val), (C.int)(searchFlags)))
|
||||
return (int32)(C.av_opt_set_double(VoidPointer(obj), (*C.char)(namePtr),
|
||||
(C.double)(val), (C.int)(searchFlags)))
|
||||
}
|
||||
|
||||
// AvOptSetQ
|
||||
func AvOptSetQ(obj CVoidPointer, name string, val AVRational, searchFlags int32) int32 {
|
||||
namePtr, nameFunc := StringCasting(name)
|
||||
defer nameFunc()
|
||||
return (int32)(C.av_opt_set_q(VoidPointer(obj), (*C.char)(namePtr), (C.struct_AVRational)(val), (C.int)(searchFlags)))
|
||||
return (int32)(C.av_opt_set_q(VoidPointer(obj), (*C.char)(namePtr),
|
||||
(C.struct_AVRational)(val), (C.int)(searchFlags)))
|
||||
}
|
||||
|
||||
// AvOptSetBin
|
||||
func AvOptSetBin(obj CVoidPointer, name string, val *uint8, size int32, searchFlags int32) int32 {
|
||||
func AvOptSetBin[U any, V Integer](obj CVoidPointer, name string, val *U, size V, searchFlags int32) int32 {
|
||||
namePtr, nameFunc := StringCasting(name)
|
||||
defer nameFunc()
|
||||
return (int32)(C.av_opt_set_bin(VoidPointer(obj), (*C.char)(namePtr), (*C.uint8_t)(val), (C.int)(size), (C.int)(searchFlags)))
|
||||
return (int32)(C.av_opt_set_bin(VoidPointer(obj), (*C.char)(namePtr),
|
||||
(*C.uint8_t)(unsafe.Pointer(val)), (C.int)(size), (C.int)(searchFlags)))
|
||||
}
|
||||
|
||||
// AvOptSetImageSize
|
||||
func AvOptSetImageSize(obj CVoidPointer, name string, w, h int32, searchFlags int32) int32 {
|
||||
namePtr, nameFunc := StringCasting(name)
|
||||
defer nameFunc()
|
||||
return (int32)(C.av_opt_set_image_size(VoidPointer(obj), (*C.char)(namePtr), (C.int)(w), (C.int)(h), (C.int)(searchFlags)))
|
||||
return (int32)(C.av_opt_set_image_size(VoidPointer(obj), (*C.char)(namePtr),
|
||||
(C.int)(w), (C.int)(h), (C.int)(searchFlags)))
|
||||
}
|
||||
|
||||
// AvOptSetPixelFmt
|
||||
func AvOptSetPixelFmt(obj CVoidPointer, name string, fmt AVPixelFormat, searchFlags int32) int32 {
|
||||
namePtr, nameFunc := StringCasting(name)
|
||||
defer nameFunc()
|
||||
return (int32)(C.av_opt_set_pixel_fmt(VoidPointer(obj), (*C.char)(namePtr), (C.enum_AVPixelFormat)(fmt), (C.int)(searchFlags)))
|
||||
return (int32)(C.av_opt_set_pixel_fmt(VoidPointer(obj), (*C.char)(namePtr),
|
||||
(C.enum_AVPixelFormat)(fmt), (C.int)(searchFlags)))
|
||||
}
|
||||
|
||||
// AvOptSetSampleFmt
|
||||
func AvOptSetSampleFmt(obj CVoidPointer, name string, fmt AVSampleFormat, searchFlags int32) int32 {
|
||||
namePtr, nameFunc := StringCasting(name)
|
||||
defer nameFunc()
|
||||
return (int32)(C.av_opt_set_sample_fmt(VoidPointer(obj), (*C.char)(namePtr), (C.enum_AVSampleFormat)(fmt), (C.int)(searchFlags)))
|
||||
return (int32)(C.av_opt_set_sample_fmt(VoidPointer(obj), (*C.char)(namePtr),
|
||||
(C.enum_AVSampleFormat)(fmt), (C.int)(searchFlags)))
|
||||
}
|
||||
|
||||
// AvOptSetVideoRate
|
||||
func AvOptSetVideoRate(obj CVoidPointer, name string, val AVRational, searchFlags int32) int32 {
|
||||
namePtr, nameFunc := StringCasting(name)
|
||||
defer nameFunc()
|
||||
return (int32)(C.av_opt_set_video_rate(VoidPointer(obj), (*C.char)(namePtr), (C.struct_AVRational)(val), (C.int)(searchFlags)))
|
||||
return (int32)(C.av_opt_set_video_rate(VoidPointer(obj), (*C.char)(namePtr),
|
||||
(C.struct_AVRational)(val), (C.int)(searchFlags)))
|
||||
}
|
||||
|
||||
// AvOptSetChannelLayout
|
||||
func AvOptSetChannelLayout(obj CVoidPointer, name string, chLayout int64, searchFlags int32) int32 {
|
||||
namePtr, nameFunc := StringCasting(name)
|
||||
defer nameFunc()
|
||||
return (int32)(C.av_opt_set_channel_layout(VoidPointer(obj), (*C.char)(namePtr), (C.int64_t)(chLayout), (C.int)(searchFlags)))
|
||||
return (int32)(C.av_opt_set_channel_layout(VoidPointer(obj), (*C.char)(namePtr),
|
||||
(C.int64_t)(chLayout), (C.int)(searchFlags)))
|
||||
}
|
||||
|
||||
// AvOptSetDictVal
|
||||
func AvOptSetDictVal(obj CVoidPointer, name string, val *AVDictionary, searchFlags int32) int32 {
|
||||
namePtr, nameFunc := StringCasting(name)
|
||||
defer nameFunc()
|
||||
return (int32)(C.av_opt_set_dict_val(VoidPointer(obj), (*C.char)(namePtr), (*C.struct_AVDictionary)(val), (C.int)(searchFlags)))
|
||||
return (int32)(C.av_opt_set_dict_val(VoidPointer(obj), (*C.char)(namePtr),
|
||||
(*C.struct_AVDictionary)(val), (C.int)(searchFlags)))
|
||||
}
|
||||
|
||||
// AvOptSetIntList sets a binary option to an integer list.
|
||||
@@ -621,64 +636,72 @@ func AvOptGet(obj CVoidPointer, name string, searchFlags int32, outVal **uint8)
|
||||
func AvOptGetInt(obj CVoidPointer, name string, searchFlags int32, outVal *int64) int32 {
|
||||
namePtr, nameFunc := StringCasting(name)
|
||||
defer nameFunc()
|
||||
return (int32)(C.av_opt_get_int(VoidPointer(obj), (*C.char)(namePtr), (C.int)(searchFlags), (*C.int64_t)(outVal)))
|
||||
return (int32)(C.av_opt_get_int(VoidPointer(obj), (*C.char)(namePtr),
|
||||
(C.int)(searchFlags), (*C.int64_t)(outVal)))
|
||||
}
|
||||
|
||||
// AvOptGetDouble
|
||||
func AvOptGetDouble(obj CVoidPointer, name string, searchFlags int32, outVal *float64) int32 {
|
||||
namePtr, nameFunc := StringCasting(name)
|
||||
defer nameFunc()
|
||||
return (int32)(C.av_opt_get_double(VoidPointer(obj), (*C.char)(namePtr), (C.int)(searchFlags), (*C.double)(outVal)))
|
||||
return (int32)(C.av_opt_get_double(VoidPointer(obj), (*C.char)(namePtr),
|
||||
(C.int)(searchFlags), (*C.double)(outVal)))
|
||||
}
|
||||
|
||||
// AvOptGetQ
|
||||
func AvOptGetQ(obj CVoidPointer, name string, searchFlags int32, outVal *AVRational) int32 {
|
||||
namePtr, nameFunc := StringCasting(name)
|
||||
defer nameFunc()
|
||||
return (int32)(C.av_opt_get_q(VoidPointer(obj), (*C.char)(namePtr), (C.int)(searchFlags), (*C.struct_AVRational)(outVal)))
|
||||
return (int32)(C.av_opt_get_q(VoidPointer(obj), (*C.char)(namePtr),
|
||||
(C.int)(searchFlags), (*C.struct_AVRational)(outVal)))
|
||||
}
|
||||
|
||||
// AvOptGetImageSize
|
||||
func AvOptGetImageSize(obj CVoidPointer, name string, searchFlags int32, wOut, hOut *int32) int32 {
|
||||
namePtr, nameFunc := StringCasting(name)
|
||||
defer nameFunc()
|
||||
return (int32)(C.av_opt_get_image_size(VoidPointer(obj), (*C.char)(namePtr), (C.int)(searchFlags), (*C.int)(wOut), (*C.int)(hOut)))
|
||||
return (int32)(C.av_opt_get_image_size(VoidPointer(obj), (*C.char)(namePtr),
|
||||
(C.int)(searchFlags), (*C.int)(wOut), (*C.int)(hOut)))
|
||||
}
|
||||
|
||||
// AvOptGetPixelFmt
|
||||
func AvOptGetPixelFmt(obj CVoidPointer, name string, searchFlags int32, outFmt *AVPixelFormat) int32 {
|
||||
namePtr, nameFunc := StringCasting(name)
|
||||
defer nameFunc()
|
||||
return (int32)(C.av_opt_get_pixel_fmt(VoidPointer(obj), (*C.char)(namePtr), (C.int)(searchFlags), (*C.enum_AVPixelFormat)(outFmt)))
|
||||
return (int32)(C.av_opt_get_pixel_fmt(VoidPointer(obj), (*C.char)(namePtr),
|
||||
(C.int)(searchFlags), (*C.enum_AVPixelFormat)(outFmt)))
|
||||
}
|
||||
|
||||
// AvOptGetSampleFmt
|
||||
func AvOptGetSampleFmt(obj CVoidPointer, name string, searchFlags int32, outFmt *AVSampleFormat) int32 {
|
||||
namePtr, nameFunc := StringCasting(name)
|
||||
defer nameFunc()
|
||||
return (int32)(C.av_opt_get_sample_fmt(VoidPointer(obj), (*C.char)(namePtr), (C.int)(searchFlags), (*C.enum_AVSampleFormat)(outFmt)))
|
||||
return (int32)(C.av_opt_get_sample_fmt(VoidPointer(obj), (*C.char)(namePtr),
|
||||
(C.int)(searchFlags), (*C.enum_AVSampleFormat)(outFmt)))
|
||||
}
|
||||
|
||||
// AvOptGetVideoRate
|
||||
func AvOptGetVideoRate(obj CVoidPointer, name string, searchFlags int32, outVal *AVRational) int32 {
|
||||
namePtr, nameFunc := StringCasting(name)
|
||||
defer nameFunc()
|
||||
return (int32)(C.av_opt_get_video_rate(VoidPointer(obj), (*C.char)(namePtr), (C.int)(searchFlags), (*C.struct_AVRational)(outVal)))
|
||||
return (int32)(C.av_opt_get_video_rate(VoidPointer(obj), (*C.char)(namePtr),
|
||||
(C.int)(searchFlags), (*C.struct_AVRational)(outVal)))
|
||||
}
|
||||
|
||||
// AvOptGetChannelLayout
|
||||
func AvOptGetChannelLayout(obj CVoidPointer, name string, searchFlags int32, outVal *int64) int32 {
|
||||
namePtr, nameFunc := StringCasting(name)
|
||||
defer nameFunc()
|
||||
return (int32)(C.av_opt_get_channel_layout(VoidPointer(obj), (*C.char)(namePtr), (C.int)(searchFlags), (*C.int64_t)(outVal)))
|
||||
return (int32)(C.av_opt_get_channel_layout(VoidPointer(obj), (*C.char)(namePtr),
|
||||
(C.int)(searchFlags), (*C.int64_t)(outVal)))
|
||||
}
|
||||
|
||||
// AvOptGetDictVal
|
||||
func AvOptGetDictVal(obj CVoidPointer, name string, searchFlags int32, outVal **AVDictionary) int32 {
|
||||
namePtr, nameFunc := StringCasting(name)
|
||||
defer nameFunc()
|
||||
return (int32)(C.av_opt_get_dict_val(VoidPointer(obj), (*C.char)(namePtr), (C.int)(searchFlags),
|
||||
(**C.struct_AVDictionary)(unsafe.Pointer(outVal))))
|
||||
return (int32)(C.av_opt_get_dict_val(VoidPointer(obj), (*C.char)(namePtr),
|
||||
(C.int)(searchFlags), (**C.struct_AVDictionary)(unsafe.Pointer(outVal))))
|
||||
}
|
||||
|
||||
// AvOptPtr gets a pointer to the requested field in a struct.
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
||||
// Use of this source code is governed by a MIT
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user