mirror of
https://github.com/Youngju-Heo/gomedia.git
synced 2025-12-24 12:12:45 +08:00
add av.HEVC, av.JPEG
This commit is contained in:
17
.vscode/launch.json
vendored
Normal file
17
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Launch",
|
||||
"type": "go",
|
||||
"request": "launch",
|
||||
"mode": "auto",
|
||||
"program": "${fileDirname}",
|
||||
"env": {},
|
||||
"args": []
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -135,6 +135,7 @@ var (
|
||||
// define video
|
||||
H264 = MakeVideoCodecType(avCodecTypeMagic + 1)
|
||||
JPEG = MakeVideoCodecType(avCodecTypeMagic + 2)
|
||||
HEVC = MakeVideoCodecType(avCodecTypeMagic + 3)
|
||||
|
||||
// define audio
|
||||
AAC = MakeAudioCodecType(avCodecTypeMagic + 1)
|
||||
@@ -154,6 +155,8 @@ func (ctype CodecType) String() string {
|
||||
return "H264"
|
||||
case JPEG:
|
||||
return "JPEG"
|
||||
case HEVC:
|
||||
return "HEVC"
|
||||
|
||||
// from audio
|
||||
case AAC:
|
||||
@@ -176,6 +179,8 @@ func (ctype CodecType) CodecName() string {
|
||||
return "h264"
|
||||
case JPEG:
|
||||
return "jpeg"
|
||||
case HEVC:
|
||||
return "hevc"
|
||||
|
||||
// from audio
|
||||
case AAC:
|
||||
@@ -238,6 +243,14 @@ type H264VideoCodecData interface {
|
||||
PPS() []byte
|
||||
}
|
||||
|
||||
// H265VideoCodecData for h264 info
|
||||
type H265VideoCodecData interface {
|
||||
VideoCodecData
|
||||
VPS() []byte
|
||||
SPS() []byte
|
||||
PPS() []byte
|
||||
}
|
||||
|
||||
// AudioCodecData AudioCodecData
|
||||
type AudioCodecData interface {
|
||||
CodecData
|
||||
|
||||
@@ -61,6 +61,8 @@ func NewDecoder(codecType av.CodecType) (*VideoDecoder, error) {
|
||||
id = C.AV_CODEC_ID_H264
|
||||
case av.JPEG:
|
||||
id = C.AV_CODEC_ID_JPEG
|
||||
case av.HEVC:
|
||||
id = C.AV_CODEC_ID_HEVC
|
||||
default:
|
||||
return nil, fmt.Errorf("invalid codec type: %v", codecType)
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"../av"
|
||||
"../utils/bits"
|
||||
"../utils/bits/pio"
|
||||
"github.com/Youngju-Heo/gomedia/core/media/av"
|
||||
"github.com/Youngju-Heo/gomedia/core/media/utils/bits"
|
||||
"github.com/Youngju-Heo/gomedia/core/media/utils/bits/pio"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user