add av.HEVC, av.JPEG

This commit is contained in:
youngju
2020-04-26 11:46:57 +09:00
parent 88c200fff0
commit 5a3a69326d
4 changed files with 35 additions and 3 deletions

17
.vscode/launch.json vendored Normal file
View 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": []
}
]
}

View File

@@ -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

View File

@@ -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)
}

View File

@@ -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 (