mirror of
https://github.com/qrtc/ffmpeg-dev-go.git
synced 2025-10-16 20:50:46 +08:00
2023-10-31 09:16:44 CST W44D2
This commit is contained in:
45
avformat.go
45
avformat.go
@@ -658,7 +658,6 @@ func (stm *AVStream) GetEventFlagsAddr() *int32 {
|
||||
|
||||
const (
|
||||
AVSTREAM_EVENT_FLAG_METADATA_UPDATED = int32(C.AVSTREAM_EVENT_FLAG_METADATA_UPDATED)
|
||||
AVSTREAM_EVENT_FLAG_NEW_PACKETS = int32(C.AVSTREAM_EVENT_FLAG_NEW_PACKETS)
|
||||
)
|
||||
|
||||
// GetRFrameRate gets `AVStream.r_frame_rate` value.
|
||||
@@ -982,8 +981,13 @@ func (cpt *AVChapter) GetMetadataAddr() **AVDictionary {
|
||||
return (**AVDictionary)(unsafe.Pointer(&cpt.metadata))
|
||||
}
|
||||
|
||||
// typedef int (*av_format_control_message)(struct AVFormatContext *s, int type,
|
||||
// void *data, size_t data_size);
|
||||
type AVFormatControlMessageFunc C.av_format_control_message
|
||||
|
||||
// typedef int (*AVOpenCallback)(struct AVFormatContext *s,
|
||||
// AVIOContext **pb, const char *url, int flags,
|
||||
// const AVIOInterruptCB *int_cb, AVDictionary **options);
|
||||
type AVOpenCallbackFunc C.AVOpenCallback
|
||||
|
||||
// AVDurationEstimationMethod
|
||||
@@ -1140,7 +1144,7 @@ func (s *AVFormatContext) GetUrl() string {
|
||||
func (s *AVFormatContext) SetUrl(v string) {
|
||||
vPtr, _ := StringCasting(v)
|
||||
if s.url != nil {
|
||||
C.free(unsafe.Pointer(s.url))
|
||||
FreePointer(s.url)
|
||||
}
|
||||
s.url = (*C.char)(vPtr)
|
||||
}
|
||||
@@ -2073,21 +2077,6 @@ func (s *AVFormatContext) GetSkipEstimateDurationFromPtsAddr() *int32 {
|
||||
return (*int32)(&s.skip_estimate_duration_from_pts)
|
||||
}
|
||||
|
||||
// GetMaxProbePackets gets `AVFormatContext.max_probe_packets` value.
|
||||
func (s *AVFormatContext) GetMaxProbePackets() int32 {
|
||||
return (int32)(s.max_probe_packets)
|
||||
}
|
||||
|
||||
// SetMaxProbePackets sets `AVFormatContext.max_probe_packets` value.
|
||||
func (s *AVFormatContext) SetMaxProbePackets(v int32) {
|
||||
s.max_probe_packets = (C.int)(v)
|
||||
}
|
||||
|
||||
// GetMaxProbePacketsAddr gets `AVFormatContext.max_probe_packets` address.
|
||||
func (s *AVFormatContext) GetMaxProbePacketsAddr() *int32 {
|
||||
return (*int32)(&s.max_probe_packets)
|
||||
}
|
||||
|
||||
const (
|
||||
AVFMT_FLAG_GENPTS = C.AVFMT_FLAG_GENPTS
|
||||
AVFMT_FLAG_IGNIDX = C.AVFMT_FLAG_IGNIDX
|
||||
@@ -2229,6 +2218,24 @@ func AvFmtCtxGetDurationEstimationMethod(s *AVFormatContext) AVDurationEstimatio
|
||||
return (AVDurationEstimationMethod)(C.av_fmt_ctx_get_duration_estimation_method((*C.struct_AVFormatContext)(s)))
|
||||
}
|
||||
|
||||
// AVPacketList
|
||||
type AVPacketList C.struct_AVPacketList
|
||||
|
||||
// Getgets `AVPacketList.next` value.
|
||||
func (pl *AVPacketList) Get() *AVPacketList {
|
||||
return (*AVPacketList)(pl.next)
|
||||
}
|
||||
|
||||
// Set sets `AVPacketList.next` value.
|
||||
func (pl *AVPacketList) Set(v *AVPacketList) {
|
||||
pl.next = (*C.struct_AVPacketList)(v)
|
||||
}
|
||||
|
||||
// GetAddr gets `AVPacketList.next` address.
|
||||
func (pl *AVPacketList) GetAddr() **AVPacketList {
|
||||
return (**AVPacketList)(unsafe.Pointer(&pl.next))
|
||||
}
|
||||
|
||||
// AvFormatVersion returns the LIBAVFORMAT_VERSION_INT constant.
|
||||
func AvFormatVersion() uint32 {
|
||||
return (uint32)(C.avformat_version())
|
||||
@@ -2396,7 +2403,7 @@ func AvProbeInputBuffer2(pb *AVIOContext, fmt **AVInputFormat,
|
||||
(*C.char)(urlPtr), VoidPointer(logctx), (C.uint)(offset), (C.uint)(maxProbeSize)))
|
||||
}
|
||||
|
||||
// AvProbeInputBuffer likes AvProbeInputBuffer2() but returns 0 on success
|
||||
// AvProbeInputBuffer likes AvProbeInputBuffer2() but returns 0 on success.
|
||||
func AvProbeInputBuffer(pb *AVIOContext, fmt **AVInputFormat,
|
||||
url string, logctx CVoidPointer, offset, maxProbeSize uint32) int32 {
|
||||
urlPtr, urlFunc := StringCasting(url)
|
||||
@@ -2414,8 +2421,6 @@ func AvFormatOpenInput(ps **AVFormatContext, url string, fmt *AVInputFormat, opt
|
||||
(*C.char)(urlPtr), (*C.struct_AVInputFormat)(fmt), (**C.struct_AVDictionary)(unsafe.Pointer(options))))
|
||||
}
|
||||
|
||||
// Deprecated: Use an AVDictionary to pass options to a demuxer.
|
||||
//
|
||||
// AvDemuxerOpen
|
||||
func AvDemuxerOpen(ic *AVFormatContext) int32 {
|
||||
return (int32)(C.av_demuxer_open((*C.struct_AVFormatContext)(ic)))
|
||||
|
Reference in New Issue
Block a user