-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This implements hardware decoding continuing from the work of @rvillalba-novetta and @mikeboers in main...rvillalba-novetta:PyAV:hwaccel (and children commits)
- Loading branch information
1 parent
6eaf701
commit 2a7e38b
Showing
27 changed files
with
674 additions
and
38 deletions.
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
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
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
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
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
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,22 @@ | ||
cimport libav as lib | ||
|
||
from av.codec.codec cimport Codec | ||
|
||
|
||
cdef class HWConfig(object): | ||
cdef object __weakref__ | ||
cdef lib.AVCodecHWConfig *ptr | ||
cdef void _init(self, lib.AVCodecHWConfig *ptr) | ||
|
||
cdef HWConfig wrap_hwconfig(lib.AVCodecHWConfig *ptr) | ||
|
||
cdef class HWAccel(object): | ||
cdef int _device_type | ||
cdef str _device | ||
cdef public bint allow_software_fallback | ||
cdef public dict options | ||
|
||
cdef class HWAccelContext(HWAccel): | ||
cdef readonly Codec codec | ||
cdef readonly HWConfig config | ||
cdef lib.AVBufferRef *ptr |
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,46 @@ | ||
from enum import IntEnum | ||
from typing import Sequence | ||
|
||
from av.codec.codec import Codec | ||
|
||
class HWDeviceType(IntEnum): | ||
NONE = int | ||
VDPAU = int | ||
CUDA = int | ||
VAAPI = int | ||
DXVA2 = int | ||
QSV = int | ||
VIDEOTOOLBOX = int | ||
D3D11VA = int | ||
DRM = int | ||
OPENCL = int | ||
MEDIACODEC = int | ||
VULKAN = int | ||
D3D12VA = int | ||
|
||
class HWConfig(object): | ||
def __init__(self, sentinel): ... | ||
def __repr__(self): ... | ||
@property | ||
def device_type(self): ... | ||
@property | ||
def format(self): ... | ||
@property | ||
def methods(self): ... | ||
@property | ||
def is_supported(self): ... | ||
|
||
class HWAccel: | ||
def __init__( | ||
self, | ||
device_type: str | HWDeviceType, | ||
device: str | None = None, | ||
allow_software_fallback: bool = True, | ||
options=None, | ||
**kwargs | ||
): ... | ||
def create(self, codec: Codec): ... | ||
|
||
hwdevices_available: Sequence[str] | ||
|
||
def dump_hwdevices() -> None: ... |
Oops, something went wrong.