documentation; renamed funcs

This commit is contained in:
H.G. Giorgis
2015-09-04 15:51:17 -04:00
parent b288a1a7da
commit 3f58dc9650
24 changed files with 132 additions and 125 deletions
+5 -4
View File
@@ -1,7 +1,8 @@
/*
The codecs (decoders and encoders) provided by the libavcodec library
libavcodec provides some generic global options, which can be set on all the encoders and decoders.
*/
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
//The codecs (decoders and encoders) provided by the libavcodec library
//libavcodec provides some generic global options, which can be set on all the encoders and decoders.
package avcodec
//#cgo pkg-config: libavformat libavcodec libavutil libswresample
+4 -3
View File
@@ -1,6 +1,7 @@
/*
AvPicture
*/
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
// Avpicture
package avcodec
//#cgo pkg-config: libavcodec
+4 -3
View File
@@ -1,6 +1,7 @@
/*
AvPicture
*/
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
// Bit Stream Filters
package avcodec
//#cgo pkg-config: libavcodec
+3 -5
View File
@@ -1,9 +1,7 @@
/*
Use of this source code is governed by a MIT license that can be found in the LICENSE file.
by Giorgis (habtom@giorgis.io)
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
Multiple encoders have the same ID and are able to encode compatible streams.
*/
// Multiple encoders have the same ID and are able to encode compatible streams.
package avcodec
//#cgo pkg-config: libavformat
+4 -3
View File
@@ -1,6 +1,7 @@
/*
Context
*/
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
// Avcodec context methods
package avcodec
//#cgo pkg-config: libavcodec
+4 -3
View File
@@ -1,6 +1,7 @@
/*
Use of this source code is governed by a MIT license that can be found in the LICENSE file.
*/
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
// Context struct values
package avcodec
func (ctxt *Context) ActiveThreadType() int {
+4 -3
View File
@@ -1,6 +1,7 @@
/*
AvPackets
*/
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
// Packet methods
package avcodec
//#cgo pkg-config: libavcodec
+4 -4
View File
@@ -1,7 +1,7 @@
/*
Use of this source code is governed by a MIT license that can be found in the LICENSE file.
by Giorgis (habtom@giorgis.io)
*/
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
// Packet
package avcodec
func (p *Packet) Buf() *AvBufferRef {
+9 -8
View File
@@ -1,6 +1,7 @@
/*
PixelFormat
*/
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
// Pixelformat
package avcodec
//#cgo pkg-config: libavcodec
@@ -11,24 +12,24 @@ import (
)
//Utility function to access log2_chroma_w log2_chroma_h from the pixel format AvPixFmtDescriptor.
func (p PixelFormat) Avcodec_get_chroma_sub_sample(h, v *int) {
func (p PixelFormat) AvcodecGetChromaSubSample(h, v *int) {
C.avcodec_get_chroma_sub_sample((C.enum_AVPixelFormat)(p), (*C.int)(unsafe.Pointer(h)), (*C.int)(unsafe.Pointer(v)))
}
//Return a value representing the fourCC code associated to the pixel format pix_fmt, or 0 if no associated fourCC code can be found.
func (p PixelFormat) Avcodec_pix_fmt_to_codec_tag() uint {
func (p PixelFormat) AvcodecPixFmtToCodecTag() uint {
return uint(C.avcodec_pix_fmt_to_codec_tag((C.enum_AVPixelFormat)(p)))
}
func (p PixelFormat) Avcodec_get_pix_fmt_loss(f PixelFormat, a int) int {
func (p PixelFormat) AvcodecGetPixFmtLoss(f PixelFormat, a int) int {
return int(C.avcodec_get_pix_fmt_loss((C.enum_AVPixelFormat)(p), (C.enum_AVPixelFormat)(f), C.int(a)))
}
//Find the best pixel format to convert to given a certain source pixel format.
func (p *PixelFormat) Avcodec_find_best_pix_fmt_of_list(s PixelFormat, a int, l *int) PixelFormat {
func (p *PixelFormat) AvcodecFindBestPixFmtOfList(s PixelFormat, a int, l *int) PixelFormat {
return (PixelFormat)(C.avcodec_find_best_pix_fmt_of_list((*C.enum_AVPixelFormat)(p), (C.enum_AVPixelFormat)(s), C.int(a), (*C.int)(unsafe.Pointer(l))))
}
func (p PixelFormat) Avcodec_find_best_pix_fmt_of_2(f2, s PixelFormat, a int, l *int) PixelFormat {
func (p PixelFormat) AvcodecFindBestPixFmtOf2(f2, s PixelFormat, a int, l *int) PixelFormat {
return (PixelFormat)(C.avcodec_find_best_pix_fmt_of_2((C.enum_AVPixelFormat)(p), (C.enum_AVPixelFormat)(f2), (C.enum_AVPixelFormat)(s), C.int(a), (*C.int)(unsafe.Pointer(l))))
}
+6 -8
View File
@@ -1,12 +1,10 @@
/*
Use of this source code is governed by a MIT license that can be found in the LICENSE file.
by Giorgis (habtom@giorgis.io)
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
The input and output devices provided by the libavdevice library
The libavdevice library provides the same interface as libavformat.
Namely, an input device is considered like a demuxer, and an output device like a muxer,
and the interface and generic device options are the same provided by libavformat
*/
// The input and output devices provided by the libavdevice library
// The libavdevice library provides the same interface as libavformat.
// Namely, an input device is considered like a demuxer, and an output device like a muxer,
// and the interface and generic device options are the same provided by libavformat
package avdevice
/*
+8 -10
View File
@@ -1,6 +1,7 @@
/*
Format
*/
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
// Input and Output format
package avdevice
/*
@@ -8,26 +9,23 @@ package avdevice
#include <libavdevice/avdevice.h>
*/
import "C"
import (
"unsafe"
)
//Audio input devices iterator.
func (d *InputFormat) Av_input_audio_device_next() *InputFormat {
func (d *InputFormat) AvInputAudioDeviceNext() *InputFormat {
return (*InputFormat)(C.av_input_audio_device_next((*C.struct_AVInputFormat)(d)))
}
//Video input devices iterator.
func (d *InputFormat) Av_input_video_device_next() *InputFormat {
func (d *InputFormat) AvInputVideoDeviceNext() *InputFormat {
return (*InputFormat)(C.av_input_video_device_next((*C.struct_AVInputFormat)(d)))
}
//Audio output devices iterator.
func (d *OutputFormat) Av_output_audio_device_next() *OutputFormat {
func (d *OutputFormat) AvOutputAudioDeviceNext() *OutputFormat {
return (*OutputFormat)(C.av_output_audio_device_next((*C.struct_AVOutputFormat)(d)))
}
//Video output devices iterator.
func (d *OutputFormat) Av_output_video_device_next() *OutputFormat {
func (d *OutputFormat) AvOutputVideoDeviceNext() *OutputFormat {
return (*OutputFormat)(C.av_output_video_device_next((*C.struct_AVOutputFormat)(d)))
}
+8 -7
View File
@@ -1,7 +1,8 @@
/*
Filters in the same linear chain are separated by commas, and distinct linear chains of filters are separated by semicolons.
FFmpeg is enabled through the "C" libavfilter library
*/
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
//Filters in the same linear chain are separated by commas, and distinct linear chains of filters are separated by semicolons.
//FFmpeg is enabled through the "C" libavfilter library
package avfilter
/*
@@ -123,19 +124,19 @@ func Avfilter_next(f *Filter) *Filter {
//int avfilter_init_str (Context *ctx, const char *args)
//Initialize a filter with the supplied parameters.
func (ctx *Context) Avfilter_init_str(args string) int {
func (ctx *Context) AvfilterInitStr(args string) int {
return int(C.avfilter_init_str((*C.struct_AVFilterContext)(ctx), C.CString(args)))
}
//int avfilter_init_dict (Context *ctx, Dictionary **options)
//Initialize a filter with the supplied dictionary of options.
func (ctx *Context) Avfilter_init_dict(o **Dictionary) int {
func (ctx *Context) AvfilterInitDict(o **Dictionary) int {
return int(C.avfilter_init_dict((*C.struct_AVFilterContext)(ctx), (**C.struct_AVDictionary)(unsafe.Pointer(o))))
}
//void avfilter_free (Context *filter)
//Free a filter context.
func (ctx *Context) Avfilter_free() {
func (ctx *Context) AvfilterFree() {
C.avfilter_free((*C.struct_AVFilterContext)(ctx))
}
+6 -5
View File
@@ -1,8 +1,9 @@
/*
The libavformat library provides some generic global options, which can be set on all the muxers and demuxers.
In addition each muxer or demuxer may support so-called private options, which are specific for that component.
Supported formats (muxers and demuxers) provided by the libavformat library
*/
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
//The libavformat library provides some generic global options, which can be set on all the muxers and demuxers.
//In addition each muxer or demuxer may support so-called private options, which are specific for that component.
//Supported formats (muxers and demuxers) provided by the libavformat library
package avformat
//#cgo pkg-config: libavformat libavcodec libavutil libavdevice libavfilter libswresample libswscale
+4 -3
View File
@@ -1,6 +1,7 @@
/*
Use of this source code is governed by a MIT license that can be found in the LICENSE file.
*/
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
// Format Context
package avformat
//#cgo pkg-config: libavformat
+4 -4
View File
@@ -1,7 +1,7 @@
/*
Use of this source code is governed by a MIT license that can be found in the LICENSE file.
by Giorgis (habtom@giorgis.io)
*/
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
// Format Context
package avformat
//#cgo pkg-config: libavformat
+4 -3
View File
@@ -1,6 +1,7 @@
/*
AVStream
*/
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
// Streams
package avformat
//#cgo pkg-config: libavformat
+4 -4
View File
@@ -1,7 +1,7 @@
/*
Use of this source code is governed by a MIT license that can be found in the LICENSE file.
by Giorgis (habtom@giorgis.io)
*/
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
// Stream methods
package avformat
//#cgo pkg-config: libavformat
+7 -6
View File
@@ -1,9 +1,10 @@
/*
The libavutil library is a utility library to aid portable multimedia programming.
It contains safe portable string functions, random number generators, data structures,
additional mathematics functions, cryptography and multimedia related functionality.
Some generic features and utilities provided by the libavutil library
*/
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
// The libavutil library is a utility library to aid portable multimedia programming.
// It contains safe portable string functions, random number generators, data structures,
// additional mathematics functions, cryptography and multimedia related functionality.
// Some generic features and utilities provided by the libavutil library
package avutil
//#cgo pkg-config: libavutil
+4 -4
View File
@@ -1,7 +1,7 @@
/*
Use of this source code is governed by a MIT license that can be found in the LICENSE file.
by Giorgis (habtom@giorgis.io)
*/
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
// Utility Frames
package avutil
/*
+4 -4
View File
@@ -1,7 +1,7 @@
/*
Use of this source code is governed by a MIT license that can be found in the LICENSE file.
by Giorgis (habtom@giorgis.io)
*/
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
// Utility Memory
package avutil
/*
+1
View File
@@ -1,3 +1,4 @@
//Example 01
package main
import (
+20 -19
View File
@@ -1,7 +1,8 @@
/*
The process of changing the sampling rate of a discrete signal to obtain a new discrete representation of the underlying continuous signal.
resampler provides a high-level interface to the libswresample library audio resampling utilities
*/
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
// The process of changing the sampling rate of a discrete signal to obtain a new discrete representation of the underlying continuous signal.
// resampler provides a high-level interface to the libswresample library audio resampling utilities
package swresample
/*
@@ -14,78 +15,78 @@ import (
)
//Initialize context after user parameters have been set.
func (s *Context) Swr_init() int {
func (s *Context) SwrInit() int {
return int(C.swr_init((*C.struct_SwrContext)(s)))
}
//Check whether an swr context has been initialized or not.
func (s *Context) Swr_is_initialized() int {
func (s *Context) SwrIsInitialized() int {
return int(C.swr_is_initialized((*C.struct_SwrContext)(s)))
}
//Allocate Context if needed and set/reset common parameters.
func (s *Context) Swr_alloc_set_opts(ocl int64, osf AvSampleFormat, osr int, icl int64, isf AvSampleFormat, isr, lo, lc int) *Context {
func (s *Context) SwrAllocSetOpts(ocl int64, osf AvSampleFormat, osr int, icl int64, isf AvSampleFormat, isr, lo, lc int) *Context {
return (*Context)(C.swr_alloc_set_opts((*C.struct_SwrContext)(s), C.int64_t(ocl), (C.enum_AVSampleFormat)(osf), C.int(osr), C.int64_t(icl), (C.enum_AVSampleFormat)(isf), C.int(isr), C.int(lo), unsafe.Pointer(&lc)))
}
//Context destructor functions. Free the given Context and set the pointer to NULL.
func (s *Context) Swr_free() {
func (s *Context) SwrFree() {
C.swr_free((**C.struct_SwrContext)(unsafe.Pointer(s)))
}
//Closes the context so that swr_is_initialized() returns 0.
func (s *Context) Swr_close() {
func (s *Context) SwrClose() {
C.swr_close((*C.struct_SwrContext)(s))
}
//Core conversion functions. Convert audio
func (s *Context) Swr_convert(out **uint8, oc int, in **uint8, ic int) int {
func (s *Context) SwrConvert(out **uint8, oc int, in **uint8, ic int) int {
return int(C.swr_convert((*C.struct_SwrContext)(s), (**C.uint8_t)(unsafe.Pointer(out)), C.int(oc), (**C.uint8_t)(unsafe.Pointer(in)), C.int(ic)))
}
//Convert the next timestamp from input to output timestamps are in 1/(in_sample_rate * out_sample_rate) units.
func (s *Context) Swr_next_pts(pts int64) int64 {
func (s *Context) SwrNextPts(pts int64) int64 {
return int64(C.swr_next_pts((*C.struct_SwrContext)(s), C.int64_t(pts)))
}
//Low-level option setting functions
//These functons provide a means to set low-level options that is not possible with the AvOption API.
//Activate resampling compensation ("soft" compensation).
func (s *Context) Swr_set_compensation(sd, cd int) int {
func (s *Context) SwrSetCompensation(sd, cd int) int {
return int(C.swr_set_compensation((*C.struct_SwrContext)(s), C.int(sd), C.int(cd)))
}
//Set a customized input channel mapping.
func (s *Context) Swr_set_channel_mapping(cm *int) int {
func (s *Context) SwrSetChannelMapping(cm *int) int {
return int(C.swr_set_channel_mapping((*C.struct_SwrContext)(s), (*C.int)(unsafe.Pointer(cm))))
}
//Set a customized remix matrix.
func (s *Context) Swr_set_matrix(m *int, t int) int {
func (s *Context) SwrSetMatrix(m *int, t int) int {
return int(C.swr_set_matrix((*C.struct_SwrContext)(s), (*C.double)(unsafe.Pointer(m)), C.int(t)))
}
//Sample handling functions. Drops the specified number of output samples.
func (s *Context) Swr_drop_output(c int) int {
func (s *Context) SwrDropOutput(c int) int {
return int(C.swr_drop_output((*C.struct_SwrContext)(s), C.int(c)))
}
//Injects the specified number of silence samples.
func (s *Context) Swr_inject_silence(c int) int {
func (s *Context) SwrInjectSilence(c int) int {
return int(C.swr_inject_silence((*C.struct_SwrContext)(s), C.int(c)))
}
//Gets the delay the next input sample will experience relative to the next output sample.
func (s *Context) Swr_get_delay(b int64) int64 {
func (s *Context) SwrGetDelay(b int64) int64 {
return int64(C.swr_get_delay((*C.struct_SwrContext)(s), C.int64_t(b)))
}
//Frame based API. Convert the samples in the input Frame and write them to the output Frame.
func (s *Context) Swr_convert_frame(o, i *Frame) int {
func (s *Context) SwrConvertFrame(o, i *Frame) int {
return int(C.swr_convert_frame((*C.struct_SwrContext)(s), (*C.struct_AVFrame)(o), (*C.struct_AVFrame)(i)))
}
//Configure or reconfigure the Context using the information provided by the AvFrames.
func (s *Context) Swr_config_frame(o, i *Frame) int {
func (s *Context) SwrConfigFrame(o, i *Frame) int {
return int(C.swr_config_frame((*C.struct_SwrContext)(s), (*C.struct_AVFrame)(o), (*C.struct_AVFrame)(i)))
}
+5 -7
View File
@@ -1,7 +1,8 @@
/*
The process of changing the sampling rate of a discrete signal to obtain a new discrete representation of the underlying continuous signal.
resampler provides a high-level interface to the libswresample library audio resampling utilities
*/
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
// The process of changing the sampling rate of a discrete signal to obtain a new discrete representation of the underlying continuous signal.
// resampler provides a high-level interface to the libswresample library audio resampling utilities
package swresample
/*
@@ -9,9 +10,6 @@ package swresample
#include <libswresample/swresample.h>
*/
import "C"
import (
"unsafe"
)
type (
Context C.struct_SwrContext
+6 -5
View File
@@ -1,8 +1,9 @@
/*
libswscale library performs highly optimized image scaling and colorspace and pixel format conversion operations.
Rescaling: is the process of changing the video size. Several rescaling options and algorithms are available.
Pixel format conversion: is the process of converting the image format and colorspace of the image.
*/
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)
//libswscale library performs highly optimized image scaling and colorspace and pixel format conversion operations.
//Rescaling: is the process of changing the video size. Several rescaling options and algorithms are available.
//Pixel format conversion: is the process of converting the image format and colorspace of the image.
package swscale
//#cgo pkg-config: libswscale libavutil