-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
120 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.DS_STORE | ||
coverage.out | ||
coverage.out | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package astiav | ||
|
||
//#include <libavcodec/defs.h> | ||
import "C" | ||
|
||
// https://ffmpeg.org/doxygen/7.0/group__lavc__decoding.html#ga352363bce7d3ed82c101b3bc001d1c16 | ||
type Discard C.enum_AVDiscard | ||
|
||
const ( | ||
DiscardNone = Discard(C.AVDISCARD_NONE) // discard nothing | ||
DiscardDefault = Discard(C.AVDISCARD_DEFAULT) // discard useless packets like 0 size packets in avi | ||
DiscardNonRef = Discard(C.AVDISCARD_NONREF) // discard all non reference | ||
DiscardBidirectional = Discard(C.AVDISCARD_BIDIR) // discard all bidirectional frames | ||
DiscardNonIntra = Discard(C.AVDISCARD_NONINTRA) // discard all non intra frames | ||
DiscardNonKey = Discard(C.AVDISCARD_NONKEY) // discard all frames except keyframes | ||
DiscardAll = Discard(C.AVDISCARD_ALL) // discard all | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package astiav | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestDiscard(t *testing.T) { | ||
require.Equal(t, int(DiscardNone), -16) | ||
require.Equal(t, int(DiscardDefault), 0) | ||
require.Equal(t, int(DiscardNonRef), 8) | ||
require.Equal(t, int(DiscardBidirectional), 16) | ||
require.Equal(t, int(DiscardNonIntra), 24) | ||
require.Equal(t, int(DiscardNonKey), 32) | ||
require.Equal(t, int(DiscardAll), 48) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters