Skip to content

Commit

Permalink
AvPicture to Picture renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
giorgisio committed Sep 5, 2015
1 parent 13e999c commit e8f4019
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 23 deletions.
2 changes: 1 addition & 1 deletion avcodec/avcodec.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type (
AvHWAccel C.struct_AVHWAccel
AvPacketSideData C.struct_AVPacketSideData
AvPanScan C.struct_AVPanScan
AvPicture C.struct_AVPicture
Picture C.struct_AVPicture
AvProfile C.struct_AVProfile
AvSubtitle C.struct_AVSubtitle
AvSubtitleRect C.struct_AVSubtitleRect
Expand Down
18 changes: 9 additions & 9 deletions avcodec/avpicture.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,36 @@ import (
)

//Setup the picture fields based on the specified image parameters and the provided image data buffer.
func (p *AvPicture) AvpictureFill(pt *uint8, pf PixelFormat, w, h int) int {
func (p *Picture) AvpictureFill(pt *uint8, pf PixelFormat, w, h int) int {
return int(C.avpicture_fill((*C.struct_AVPicture)(p), (*C.uint8_t)(pt), (C.enum_AVPixelFormat)(pf), C.int(w), C.int(h)))
}

//Copy pixel data from an AvPicture into a buffer.
func (p *AvPicture) AvpictureLayout(pf PixelFormat, w, h int, d *string, ds int) int {
//Copy pixel data from an Picture into a buffer.
func (p *Picture) AvpictureLayout(pf PixelFormat, w, h int, d *string, ds int) int {
return int(C.avpicture_layout((*C.struct_AVPicture)(p), (C.enum_AVPixelFormat)(pf), C.int(w), C.int(h), (*C.uchar)(unsafe.Pointer(d)), C.int(ds)))
}

//Copy image src to dst.
func (p *AvPicture) AvPictureCopy(d *AvPicture, pf PixelFormat, w, h int) {
func (p *Picture) AvPictureCopy(d *Picture, pf PixelFormat, w, h int) {
C.av_picture_copy((*C.struct_AVPicture)(d), (*C.struct_AVPicture)(p), (C.enum_AVPixelFormat)(pf), C.int(w), C.int(h))
}

//Crop image top and left side.
func (p *AvPicture) AvPictureCrop(d *AvPicture, pf PixelFormat, t, l int) int {
func (p *Picture) AvPictureCrop(d *Picture, pf PixelFormat, t, l int) int {
return int(C.av_picture_crop((*C.struct_AVPicture)(d), (*C.struct_AVPicture)(p), (C.enum_AVPixelFormat)(pf), C.int(t), C.int(l)))
}

//Pad image.
func (p *AvPicture) AvPicturePad(d *AvPicture, h, w int, pf PixelFormat, t, b, l, r int, c *int) int {
func (p *Picture) AvPicturePad(d *Picture, h, w int, pf PixelFormat, t, b, l, r int, c *int) int {
return int(C.av_picture_pad((*C.struct_AVPicture)(d), (*C.struct_AVPicture)(p), (C.int)(h), (C.int)(w), (C.enum_AVPixelFormat)(pf), (C.int)(t), (C.int)(b), (C.int)(l), (C.int)(r), (*C.int)(unsafe.Pointer(c))))
}

//Free a picture previously allocated by avpicture_alloc(). Allocate memory for the pixels of a picture and setup the AvPicture fields for it.
func (p *AvPicture) AvpictureAlloc(t PixelFormat, w, h int) int {
//Free a picture previously allocated by avpicture_alloc(). Allocate memory for the pixels of a picture and setup the Picture fields for it.
func (p *Picture) AvpictureAlloc(t PixelFormat, w, h int) int {
return int(C.avpicture_alloc((*C.struct_AVPicture)(p), (C.enum_AVPixelFormat)(t), C.int(w), C.int(h)))
}

func (p *AvPicture) AvpictureFree() {
func (p *Picture) AvpictureFree() {
C.avpicture_free((*C.struct_AVPicture)(p))
}

Expand Down
4 changes: 2 additions & 2 deletions example/tutorial01.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ func main() {

// Assign appropriate parts of buffer to image planes in videoFrameRGB
// Note that videoFrameRGB is an Frame, but Frame is a superset
// of AvPicture
avp := (*avcodec.AvPicture)(unsafe.Pointer(videoFrameRGB))
// of Picture
avp := (*avcodec.Picture)(unsafe.Pointer(videoFrameRGB))
avp.AvpictureFill((*uint8)(buffer), (avcodec.PixelFormat)(a), w, h)

// initialize SWS context for software scaling
Expand Down
17 changes: 8 additions & 9 deletions goav.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
Contains:
libavcodec: encoding/decoding library
libavfilter: graph-based frame editing library
libavformat: I/O and muxing/demuxing library
libavdevice: special devices muxing/demuxing library
libavutil: common utility library
libswresample: audio resampling, format conversion and mixing
libpostproc: post processing library
libswscale: color conversion and scaling library
libavcodec: encoding/decoding library
libavfilter: graph-based frame editing library
libavformat: I/O and muxing/demuxing library
libavdevice: special devices muxing/demuxing library
libavutil: common utility library
libswresample: audio resampling, format conversion and mixing
libpostproc: post processing library
libswscale: color conversion and scaling library
*/
package goav
1 change: 0 additions & 1 deletion swscale/context.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)

//sws conttext
package swscale

//#cgo pkg-config: libswscale libavutil
Expand Down
1 change: 0 additions & 1 deletion swscale/vector.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (habtom@giorgis.io)

//sws conttext
package swscale

//#cgo pkg-config: libswscale libavutil
Expand Down

0 comments on commit e8f4019

Please sign in to comment.