-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathstructs.gen.go
More file actions
17095 lines (14927 loc) · 446 KB
/
structs.gen.go
File metadata and controls
17095 lines (14927 loc) · 446 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package ffmpeg
import "unsafe"
// #include <libavcodec/avcodec.h>
// #include <libavcodec/codec.h>
// #include <libavcodec/codec_desc.h>
// #include <libavcodec/codec_id.h>
// #include <libavcodec/codec_par.h>
// #include <libavcodec/defs.h>
// #include <libavcodec/packet.h>
// #include <libavcodec/version.h>
// #include <libavcodec/version_major.h>
// #include <libavdevice/version.h>
// #include <libavdevice/version_major.h>
// #include <libavfilter/avfilter.h>
// #include <libavfilter/buffersink.h>
// #include <libavfilter/buffersrc.h>
// #include <libavfilter/version.h>
// #include <libavfilter/version_major.h>
// #include <libavformat/avformat.h>
// #include <libavformat/avio.h>
// #include <libavformat/version.h>
// #include <libavformat/version_major.h>
// #include <libavutil/avutil.h>
// #include <libavutil/buffer.h>
// #include <libavutil/channel_layout.h>
// #include <libavutil/dict.h>
// #include <libavutil/error.h>
// #include <libavutil/frame.h>
// #include <libavutil/hwcontext.h>
// #include <libavutil/log.h>
// #include <libavutil/mathematics.h>
// #include <libavutil/mem.h>
// #include <libavutil/opt.h>
// #include <libavutil/pixfmt.h>
// #include <libavutil/rational.h>
// #include <libavutil/samplefmt.h>
// #include <libavutil/version.h>
// #include <libpostproc/version.h>
// #include <libpostproc/version_major.h>
// #include <libswresample/version.h>
// #include <libswresample/version_major.h>
// #include <libswscale/version.h>
// #include <libswscale/version_major.h>
import "C"
// --- Struct RcOverride ---
// RcOverride wraps RcOverride.
type RcOverride struct {
ptr *C.RcOverride
}
func (s *RcOverride) RawPtr() unsafe.Pointer {
return unsafe.Pointer(s.ptr)
}
func ToRcOverrideArray(ptr unsafe.Pointer) *Array[*RcOverride] {
if ptr == nil {
return nil
}
return &Array[*RcOverride]{
elemSize: ptrSize,
loadPtr: func(pointer unsafe.Pointer) *RcOverride {
ptr := (**C.RcOverride)(pointer)
value := *ptr
var valueMapped *RcOverride
if value != nil {
valueMapped = &RcOverride{ptr: value}
}
return valueMapped
},
ptr: ptr,
storePtr: func(pointer unsafe.Pointer, value *RcOverride) {
ptr := (**C.RcOverride)(pointer)
if value != nil {
*ptr = value.ptr
} else {
*ptr = nil
}
},
}
}
// StartFrame gets the start_frame field.
func (s *RcOverride) StartFrame() int {
value := s.ptr.start_frame
return int(value)
}
// SetStartFrame sets the start_frame field.
func (s *RcOverride) SetStartFrame(value int) {
s.ptr.start_frame = (C.int)(value)
}
// EndFrame gets the end_frame field.
func (s *RcOverride) EndFrame() int {
value := s.ptr.end_frame
return int(value)
}
// SetEndFrame sets the end_frame field.
func (s *RcOverride) SetEndFrame(value int) {
s.ptr.end_frame = (C.int)(value)
}
// Qscale gets the qscale field.
//
// If this is 0 then quality_factor will be used instead.
func (s *RcOverride) Qscale() int {
value := s.ptr.qscale
return int(value)
}
// SetQscale sets the qscale field.
//
// If this is 0 then quality_factor will be used instead.
func (s *RcOverride) SetQscale(value int) {
s.ptr.qscale = (C.int)(value)
}
// QualityFactor gets the quality_factor field.
func (s *RcOverride) QualityFactor() float32 {
value := s.ptr.quality_factor
return float32(value)
}
// SetQualityFactor sets the quality_factor field.
func (s *RcOverride) SetQualityFactor(value float32) {
s.ptr.quality_factor = (C.float)(value)
}
// --- Struct AVCodecContext ---
// AVCodecContext wraps AVCodecContext.
/*
main external API structure.
New fields can be added to the end with minor version bumps.
Removal, reordering and changes to existing fields require a major
version bump.
You can use AVOptions (av_opt* / av_set/get*()) to access these fields from user
applications.
The name string for AVOptions options matches the associated command line
parameter name and can be found in libavcodec/options_table.h
The AVOption/command line parameter names differ in some cases from the C
structure field names for historic reasons or brevity.
sizeof(AVCodecContext) must not be used outside libav*.
*/
type AVCodecContext struct {
ptr *C.AVCodecContext
}
func (s *AVCodecContext) RawPtr() unsafe.Pointer {
return unsafe.Pointer(s.ptr)
}
func ToAVCodecContextArray(ptr unsafe.Pointer) *Array[*AVCodecContext] {
if ptr == nil {
return nil
}
return &Array[*AVCodecContext]{
elemSize: ptrSize,
loadPtr: func(pointer unsafe.Pointer) *AVCodecContext {
ptr := (**C.AVCodecContext)(pointer)
value := *ptr
var valueMapped *AVCodecContext
if value != nil {
valueMapped = &AVCodecContext{ptr: value}
}
return valueMapped
},
ptr: ptr,
storePtr: func(pointer unsafe.Pointer, value *AVCodecContext) {
ptr := (**C.AVCodecContext)(pointer)
if value != nil {
*ptr = value.ptr
} else {
*ptr = nil
}
},
}
}
// AvClass gets the av_class field.
/*
information on struct for av_log
- set by avcodec_alloc_context3
*/
func (s *AVCodecContext) AvClass() *AVClass {
value := s.ptr.av_class
var valueMapped *AVClass
if value != nil {
valueMapped = &AVClass{ptr: value}
}
return valueMapped
}
// SetAvClass sets the av_class field.
/*
information on struct for av_log
- set by avcodec_alloc_context3
*/
func (s *AVCodecContext) SetAvClass(value *AVClass) {
if value != nil {
s.ptr.av_class = value.ptr
} else {
s.ptr.av_class = nil
}
}
// LogLevelOffset gets the log_level_offset field.
func (s *AVCodecContext) LogLevelOffset() int {
value := s.ptr.log_level_offset
return int(value)
}
// SetLogLevelOffset sets the log_level_offset field.
func (s *AVCodecContext) SetLogLevelOffset(value int) {
s.ptr.log_level_offset = (C.int)(value)
}
// CodecType gets the codec_type field.
//
// see AVMEDIA_TYPE_xxx
func (s *AVCodecContext) CodecType() AVMediaType {
value := s.ptr.codec_type
return AVMediaType(value)
}
// SetCodecType sets the codec_type field.
//
// see AVMEDIA_TYPE_xxx
func (s *AVCodecContext) SetCodecType(value AVMediaType) {
s.ptr.codec_type = (C.enum_AVMediaType)(value)
}
// Codec gets the codec field.
func (s *AVCodecContext) Codec() *AVCodec {
value := s.ptr.codec
var valueMapped *AVCodec
if value != nil {
valueMapped = &AVCodec{ptr: value}
}
return valueMapped
}
// SetCodec sets the codec field.
func (s *AVCodecContext) SetCodec(value *AVCodec) {
if value != nil {
s.ptr.codec = value.ptr
} else {
s.ptr.codec = nil
}
}
// CodecId gets the codec_id field.
//
// see AV_CODEC_ID_xxx
func (s *AVCodecContext) CodecId() AVCodecID {
value := s.ptr.codec_id
return AVCodecID(value)
}
// SetCodecId sets the codec_id field.
//
// see AV_CODEC_ID_xxx
func (s *AVCodecContext) SetCodecId(value AVCodecID) {
s.ptr.codec_id = (C.enum_AVCodecID)(value)
}
// CodecTag gets the codec_tag field.
/*
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
This is used to work around some encoder bugs.
A demuxer should set this to what is stored in the field used to identify the codec.
If there are multiple such fields in a container then the demuxer should choose the one
which maximizes the information about the used codec.
If the codec tag field in a container is larger than 32 bits then the demuxer should
remap the longer ID to 32 bits with a table or other structure. Alternatively a new
extra_codec_tag + size could be added but for this a clear advantage must be demonstrated
first.
- encoding: Set by user, if not then the default based on codec_id will be used.
- decoding: Set by user, will be converted to uppercase by libavcodec during init.
*/
func (s *AVCodecContext) CodecTag() uint {
value := s.ptr.codec_tag
return uint(value)
}
// SetCodecTag sets the codec_tag field.
/*
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
This is used to work around some encoder bugs.
A demuxer should set this to what is stored in the field used to identify the codec.
If there are multiple such fields in a container then the demuxer should choose the one
which maximizes the information about the used codec.
If the codec tag field in a container is larger than 32 bits then the demuxer should
remap the longer ID to 32 bits with a table or other structure. Alternatively a new
extra_codec_tag + size could be added but for this a clear advantage must be demonstrated
first.
- encoding: Set by user, if not then the default based on codec_id will be used.
- decoding: Set by user, will be converted to uppercase by libavcodec during init.
*/
func (s *AVCodecContext) SetCodecTag(value uint) {
s.ptr.codec_tag = (C.uint)(value)
}
// PrivData gets the priv_data field.
func (s *AVCodecContext) PrivData() unsafe.Pointer {
value := s.ptr.priv_data
return value
}
// SetPrivData sets the priv_data field.
func (s *AVCodecContext) SetPrivData(value unsafe.Pointer) {
s.ptr.priv_data = value
}
// internal skipped due to ptr to ignored type
// Opaque gets the opaque field.
/*
Private data of the user, can be used to carry app specific stuff.
- encoding: Set by user.
- decoding: Set by user.
*/
func (s *AVCodecContext) Opaque() unsafe.Pointer {
value := s.ptr.opaque
return value
}
// SetOpaque sets the opaque field.
/*
Private data of the user, can be used to carry app specific stuff.
- encoding: Set by user.
- decoding: Set by user.
*/
func (s *AVCodecContext) SetOpaque(value unsafe.Pointer) {
s.ptr.opaque = value
}
// BitRate gets the bit_rate field.
/*
the average bitrate
- encoding: Set by user; unused for constant quantizer encoding.
- decoding: Set by user, may be overwritten by libavcodec
if this info is available in the stream
*/
func (s *AVCodecContext) BitRate() int64 {
value := s.ptr.bit_rate
return int64(value)
}
// SetBitRate sets the bit_rate field.
/*
the average bitrate
- encoding: Set by user; unused for constant quantizer encoding.
- decoding: Set by user, may be overwritten by libavcodec
if this info is available in the stream
*/
func (s *AVCodecContext) SetBitRate(value int64) {
s.ptr.bit_rate = (C.int64_t)(value)
}
// BitRateTolerance gets the bit_rate_tolerance field.
/*
number of bits the bitstream is allowed to diverge from the reference.
the reference can be CBR (for CBR pass1) or VBR (for pass2)
- encoding: Set by user; unused for constant quantizer encoding.
- decoding: unused
*/
func (s *AVCodecContext) BitRateTolerance() int {
value := s.ptr.bit_rate_tolerance
return int(value)
}
// SetBitRateTolerance sets the bit_rate_tolerance field.
/*
number of bits the bitstream is allowed to diverge from the reference.
the reference can be CBR (for CBR pass1) or VBR (for pass2)
- encoding: Set by user; unused for constant quantizer encoding.
- decoding: unused
*/
func (s *AVCodecContext) SetBitRateTolerance(value int) {
s.ptr.bit_rate_tolerance = (C.int)(value)
}
// GlobalQuality gets the global_quality field.
/*
Global quality for codecs which cannot change it per frame.
This should be proportional to MPEG-1/2/4 qscale.
- encoding: Set by user.
- decoding: unused
*/
func (s *AVCodecContext) GlobalQuality() int {
value := s.ptr.global_quality
return int(value)
}
// SetGlobalQuality sets the global_quality field.
/*
Global quality for codecs which cannot change it per frame.
This should be proportional to MPEG-1/2/4 qscale.
- encoding: Set by user.
- decoding: unused
*/
func (s *AVCodecContext) SetGlobalQuality(value int) {
s.ptr.global_quality = (C.int)(value)
}
// CompressionLevel gets the compression_level field.
/*
- encoding: Set by user.
- decoding: unused
*/
func (s *AVCodecContext) CompressionLevel() int {
value := s.ptr.compression_level
return int(value)
}
// SetCompressionLevel sets the compression_level field.
/*
- encoding: Set by user.
- decoding: unused
*/
func (s *AVCodecContext) SetCompressionLevel(value int) {
s.ptr.compression_level = (C.int)(value)
}
// Flags gets the flags field.
/*
AV_CODEC_FLAG_*.
- encoding: Set by user.
- decoding: Set by user.
*/
func (s *AVCodecContext) Flags() int {
value := s.ptr.flags
return int(value)
}
// SetFlags sets the flags field.
/*
AV_CODEC_FLAG_*.
- encoding: Set by user.
- decoding: Set by user.
*/
func (s *AVCodecContext) SetFlags(value int) {
s.ptr.flags = (C.int)(value)
}
// Flags2 gets the flags2 field.
/*
AV_CODEC_FLAG2_*
- encoding: Set by user.
- decoding: Set by user.
*/
func (s *AVCodecContext) Flags2() int {
value := s.ptr.flags2
return int(value)
}
// SetFlags2 sets the flags2 field.
/*
AV_CODEC_FLAG2_*
- encoding: Set by user.
- decoding: Set by user.
*/
func (s *AVCodecContext) SetFlags2(value int) {
s.ptr.flags2 = (C.int)(value)
}
// Extradata gets the extradata field.
/*
some codecs need / can use extradata like Huffman tables.
MJPEG: Huffman tables
rv10: additional flags
MPEG-4: global headers (they can be in the bitstream or here)
The allocated memory should be AV_INPUT_BUFFER_PADDING_SIZE bytes larger
than extradata_size to avoid problems if it is read with the bitstream reader.
The bytewise contents of extradata must not depend on the architecture or CPU endianness.
Must be allocated with the av_malloc() family of functions.
- encoding: Set/allocated/freed by libavcodec.
- decoding: Set/allocated/freed by user.
*/
func (s *AVCodecContext) Extradata() unsafe.Pointer {
value := s.ptr.extradata
return unsafe.Pointer(value)
}
// SetExtradata sets the extradata field.
/*
some codecs need / can use extradata like Huffman tables.
MJPEG: Huffman tables
rv10: additional flags
MPEG-4: global headers (they can be in the bitstream or here)
The allocated memory should be AV_INPUT_BUFFER_PADDING_SIZE bytes larger
than extradata_size to avoid problems if it is read with the bitstream reader.
The bytewise contents of extradata must not depend on the architecture or CPU endianness.
Must be allocated with the av_malloc() family of functions.
- encoding: Set/allocated/freed by libavcodec.
- decoding: Set/allocated/freed by user.
*/
func (s *AVCodecContext) SetExtradata(value unsafe.Pointer) {
s.ptr.extradata = (*C.uint8_t)(value)
}
// ExtradataSize gets the extradata_size field.
func (s *AVCodecContext) ExtradataSize() int {
value := s.ptr.extradata_size
return int(value)
}
// SetExtradataSize sets the extradata_size field.
func (s *AVCodecContext) SetExtradataSize(value int) {
s.ptr.extradata_size = (C.int)(value)
}
// TimeBase gets the time_base field.
/*
This is the fundamental unit of time (in seconds) in terms
of which frame timestamps are represented. For fixed-fps content,
timebase should be 1/framerate and timestamp increments should be
identically 1.
This often, but not always is the inverse of the frame rate or field rate
for video. 1/time_base is not the average frame rate if the frame rate is not
constant.
Like containers, elementary streams also can store timestamps, 1/time_base
is the unit in which these timestamps are specified.
As example of such codec time base see ISO/IEC 14496-2:2001(E)
vop_time_increment_resolution and fixed_vop_rate
(fixed_vop_rate == 0 implies that it is different from the framerate)
- encoding: MUST be set by user.
- decoding: unused.
*/
func (s *AVCodecContext) TimeBase() *AVRational {
value := s.ptr.time_base
return &AVRational{value: value}
}
// SetTimeBase sets the time_base field.
/*
This is the fundamental unit of time (in seconds) in terms
of which frame timestamps are represented. For fixed-fps content,
timebase should be 1/framerate and timestamp increments should be
identically 1.
This often, but not always is the inverse of the frame rate or field rate
for video. 1/time_base is not the average frame rate if the frame rate is not
constant.
Like containers, elementary streams also can store timestamps, 1/time_base
is the unit in which these timestamps are specified.
As example of such codec time base see ISO/IEC 14496-2:2001(E)
vop_time_increment_resolution and fixed_vop_rate
(fixed_vop_rate == 0 implies that it is different from the framerate)
- encoding: MUST be set by user.
- decoding: unused.
*/
func (s *AVCodecContext) SetTimeBase(value *AVRational) {
s.ptr.time_base = value.value
}
// TicksPerFrame gets the ticks_per_frame field.
/*
For some codecs, the time base is closer to the field rate than the frame rate.
Most notably, H.264 and MPEG-2 specify time_base as half of frame duration
if no telecine is used ...
Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2.
@deprecated
- decoding: Use AVCodecDescriptor.props & AV_CODEC_PROP_FIELDS
- encoding: Set AVCodecContext.framerate instead
*/
func (s *AVCodecContext) TicksPerFrame() int {
value := s.ptr.ticks_per_frame
return int(value)
}
// SetTicksPerFrame sets the ticks_per_frame field.
/*
For some codecs, the time base is closer to the field rate than the frame rate.
Most notably, H.264 and MPEG-2 specify time_base as half of frame duration
if no telecine is used ...
Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2.
@deprecated
- decoding: Use AVCodecDescriptor.props & AV_CODEC_PROP_FIELDS
- encoding: Set AVCodecContext.framerate instead
*/
func (s *AVCodecContext) SetTicksPerFrame(value int) {
s.ptr.ticks_per_frame = (C.int)(value)
}
// Delay gets the delay field.
/*
Codec delay.
Encoding: Number of frames delay there will be from the encoder input to
the decoder output. (we assume the decoder matches the spec)
Decoding: Number of frames delay in addition to what a standard decoder
as specified in the spec would produce.
Video:
Number of frames the decoded output will be delayed relative to the
encoded input.
Audio:
For encoding, this field is unused (see initial_padding).
For decoding, this is the number of samples the decoder needs to
output before the decoder's output is valid. When seeking, you should
start decoding this many samples prior to your desired seek point.
- encoding: Set by libavcodec.
- decoding: Set by libavcodec.
*/
func (s *AVCodecContext) Delay() int {
value := s.ptr.delay
return int(value)
}
// SetDelay sets the delay field.
/*
Codec delay.
Encoding: Number of frames delay there will be from the encoder input to
the decoder output. (we assume the decoder matches the spec)
Decoding: Number of frames delay in addition to what a standard decoder
as specified in the spec would produce.
Video:
Number of frames the decoded output will be delayed relative to the
encoded input.
Audio:
For encoding, this field is unused (see initial_padding).
For decoding, this is the number of samples the decoder needs to
output before the decoder's output is valid. When seeking, you should
start decoding this many samples prior to your desired seek point.
- encoding: Set by libavcodec.
- decoding: Set by libavcodec.
*/
func (s *AVCodecContext) SetDelay(value int) {
s.ptr.delay = (C.int)(value)
}
// Width gets the width field.
/*
picture width / height.
@note Those fields may not match the values of the last
AVFrame output by avcodec_receive_frame() due frame
reordering.
- encoding: MUST be set by user.
- decoding: May be set by the user before opening the decoder if known e.g.
from the container. Some decoders will require the dimensions
to be set by the caller. During decoding, the decoder may
overwrite those values as required while parsing the data.
*/
func (s *AVCodecContext) Width() int {
value := s.ptr.width
return int(value)
}
// SetWidth sets the width field.
/*
picture width / height.
@note Those fields may not match the values of the last
AVFrame output by avcodec_receive_frame() due frame
reordering.
- encoding: MUST be set by user.
- decoding: May be set by the user before opening the decoder if known e.g.
from the container. Some decoders will require the dimensions
to be set by the caller. During decoding, the decoder may
overwrite those values as required while parsing the data.
*/
func (s *AVCodecContext) SetWidth(value int) {
s.ptr.width = (C.int)(value)
}
// Height gets the height field.
/*
picture width / height.
@note Those fields may not match the values of the last
AVFrame output by avcodec_receive_frame() due frame
reordering.
- encoding: MUST be set by user.
- decoding: May be set by the user before opening the decoder if known e.g.
from the container. Some decoders will require the dimensions
to be set by the caller. During decoding, the decoder may
overwrite those values as required while parsing the data.
*/
func (s *AVCodecContext) Height() int {
value := s.ptr.height
return int(value)
}
// SetHeight sets the height field.
/*
picture width / height.
@note Those fields may not match the values of the last
AVFrame output by avcodec_receive_frame() due frame
reordering.
- encoding: MUST be set by user.
- decoding: May be set by the user before opening the decoder if known e.g.
from the container. Some decoders will require the dimensions
to be set by the caller. During decoding, the decoder may
overwrite those values as required while parsing the data.
*/
func (s *AVCodecContext) SetHeight(value int) {
s.ptr.height = (C.int)(value)
}
// CodedWidth gets the coded_width field.
/*
Bitstream width / height, may be different from width/height e.g. when
the decoded frame is cropped before being output or lowres is enabled.
@note Those field may not match the value of the last
AVFrame output by avcodec_receive_frame() due frame
reordering.
- encoding: unused
- decoding: May be set by the user before opening the decoder if known
e.g. from the container. During decoding, the decoder may
overwrite those values as required while parsing the data.
*/
func (s *AVCodecContext) CodedWidth() int {
value := s.ptr.coded_width
return int(value)
}
// SetCodedWidth sets the coded_width field.
/*
Bitstream width / height, may be different from width/height e.g. when
the decoded frame is cropped before being output or lowres is enabled.
@note Those field may not match the value of the last
AVFrame output by avcodec_receive_frame() due frame
reordering.
- encoding: unused
- decoding: May be set by the user before opening the decoder if known
e.g. from the container. During decoding, the decoder may
overwrite those values as required while parsing the data.
*/
func (s *AVCodecContext) SetCodedWidth(value int) {
s.ptr.coded_width = (C.int)(value)
}
// CodedHeight gets the coded_height field.
/*
Bitstream width / height, may be different from width/height e.g. when
the decoded frame is cropped before being output or lowres is enabled.
@note Those field may not match the value of the last
AVFrame output by avcodec_receive_frame() due frame
reordering.
- encoding: unused
- decoding: May be set by the user before opening the decoder if known
e.g. from the container. During decoding, the decoder may
overwrite those values as required while parsing the data.
*/
func (s *AVCodecContext) CodedHeight() int {
value := s.ptr.coded_height
return int(value)
}
// SetCodedHeight sets the coded_height field.
/*
Bitstream width / height, may be different from width/height e.g. when
the decoded frame is cropped before being output or lowres is enabled.
@note Those field may not match the value of the last
AVFrame output by avcodec_receive_frame() due frame
reordering.
- encoding: unused
- decoding: May be set by the user before opening the decoder if known
e.g. from the container. During decoding, the decoder may
overwrite those values as required while parsing the data.
*/
func (s *AVCodecContext) SetCodedHeight(value int) {
s.ptr.coded_height = (C.int)(value)
}
// GopSize gets the gop_size field.
/*
the number of pictures in a group of pictures, or 0 for intra_only
- encoding: Set by user.
- decoding: unused
*/
func (s *AVCodecContext) GopSize() int {
value := s.ptr.gop_size
return int(value)
}
// SetGopSize sets the gop_size field.
/*
the number of pictures in a group of pictures, or 0 for intra_only
- encoding: Set by user.
- decoding: unused
*/
func (s *AVCodecContext) SetGopSize(value int) {
s.ptr.gop_size = (C.int)(value)
}
// PixFmt gets the pix_fmt field.
/*
Pixel format, see AV_PIX_FMT_xxx.
May be set by the demuxer if known from headers.
May be overridden by the decoder if it knows better.
@note This field may not match the value of the last
AVFrame output by avcodec_receive_frame() due frame
reordering.
- encoding: Set by user.
- decoding: Set by user if known, overridden by libavcodec while
parsing the data.
*/
func (s *AVCodecContext) PixFmt() AVPixelFormat {
value := s.ptr.pix_fmt
return AVPixelFormat(value)
}
// SetPixFmt sets the pix_fmt field.
/*
Pixel format, see AV_PIX_FMT_xxx.
May be set by the demuxer if known from headers.
May be overridden by the decoder if it knows better.
@note This field may not match the value of the last
AVFrame output by avcodec_receive_frame() due frame
reordering.
- encoding: Set by user.
- decoding: Set by user if known, overridden by libavcodec while
parsing the data.
*/
func (s *AVCodecContext) SetPixFmt(value AVPixelFormat) {
s.ptr.pix_fmt = (C.enum_AVPixelFormat)(value)
}
// draw_horiz_band skipped due to func ptr
// get_format skipped due to func ptr
// MaxBFrames gets the max_b_frames field.
/*
maximum number of B-frames between non-B-frames
Note: The output will be delayed by max_b_frames+1 relative to the input.
- encoding: Set by user.
- decoding: unused
*/
func (s *AVCodecContext) MaxBFrames() int {
value := s.ptr.max_b_frames
return int(value)
}
// SetMaxBFrames sets the max_b_frames field.
/*
maximum number of B-frames between non-B-frames
Note: The output will be delayed by max_b_frames+1 relative to the input.
- encoding: Set by user.
- decoding: unused
*/
func (s *AVCodecContext) SetMaxBFrames(value int) {
s.ptr.max_b_frames = (C.int)(value)
}
// BQuantFactor gets the b_quant_factor field.
/*
qscale factor between IP and B-frames
If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset).
If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
- encoding: Set by user.
- decoding: unused
*/
func (s *AVCodecContext) BQuantFactor() float32 {
value := s.ptr.b_quant_factor
return float32(value)
}
// SetBQuantFactor sets the b_quant_factor field.
/*
qscale factor between IP and B-frames
If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset).
If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
- encoding: Set by user.
- decoding: unused
*/
func (s *AVCodecContext) SetBQuantFactor(value float32) {
s.ptr.b_quant_factor = (C.float)(value)
}
// BQuantOffset gets the b_quant_offset field.
/*
qscale offset between IP and B-frames
- encoding: Set by user.
- decoding: unused
*/
func (s *AVCodecContext) BQuantOffset() float32 {
value := s.ptr.b_quant_offset
return float32(value)
}
// SetBQuantOffset sets the b_quant_offset field.
/*
qscale offset between IP and B-frames
- encoding: Set by user.
- decoding: unused
*/
func (s *AVCodecContext) SetBQuantOffset(value float32) {
s.ptr.b_quant_offset = (C.float)(value)
}
// HasBFrames gets the has_b_frames field.
/*
Size of the frame reordering buffer in the decoder.
For MPEG-2 it is 1 IPB or 0 low delay IP.
- encoding: Set by libavcodec.
- decoding: Set by libavcodec.
*/
func (s *AVCodecContext) HasBFrames() int {
value := s.ptr.has_b_frames
return int(value)
}
// SetHasBFrames sets the has_b_frames field.
/*
Size of the frame reordering buffer in the decoder.
For MPEG-2 it is 1 IPB or 0 low delay IP.
- encoding: Set by libavcodec.
- decoding: Set by libavcodec.
*/
func (s *AVCodecContext) SetHasBFrames(value int) {
s.ptr.has_b_frames = (C.int)(value)
}
// IQuantFactor gets the i_quant_factor field.
/*
qscale factor between P- and I-frames
If > 0 then the last P-frame quantizer will be used (q = lastp_q * factor + offset).
If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
- encoding: Set by user.
- decoding: unused
*/
func (s *AVCodecContext) IQuantFactor() float32 {
value := s.ptr.i_quant_factor
return float32(value)
}
// SetIQuantFactor sets the i_quant_factor field.
/*
qscale factor between P- and I-frames
If > 0 then the last P-frame quantizer will be used (q = lastp_q * factor + offset).
If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
- encoding: Set by user.
- decoding: unused
*/
func (s *AVCodecContext) SetIQuantFactor(value float32) {
s.ptr.i_quant_factor = (C.float)(value)
}
// IQuantOffset gets the i_quant_offset field.
/*
qscale offset between P and I-frames
- encoding: Set by user.
- decoding: unused
*/
func (s *AVCodecContext) IQuantOffset() float32 {
value := s.ptr.i_quant_offset
return float32(value)
}
// SetIQuantOffset sets the i_quant_offset field.
/*
qscale offset between P and I-frames
- encoding: Set by user.
- decoding: unused
*/
func (s *AVCodecContext) SetIQuantOffset(value float32) {