Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ftl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nicolas Pope
ftl
Commits
a58d10bd
Commit
a58d10bd
authored
5 years ago
by
Sebastian
Browse files
Options
Downloads
Patches
Plain Diff
release picture
parent
12ec626e
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!155
Feature/python
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/ftl/libde265.py
+16
-1
16 additions, 1 deletion
python/ftl/libde265.py
with
16 additions
and
1 deletion
python/ftl/libde265.py
+
16
−
1
View file @
a58d10bd
...
...
@@ -104,6 +104,7 @@ libde265.de265_push_NAL.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_i
libde265
.
de265_push_data
.
restype
=
ctypes
.
c_int
libde265
.
de265_push_end_of_frame
.
argtypes
=
[
ctypes
.
c_void_p
]
libde265
.
de265_push_end_of_frame
.
restype
=
None
libde265
.
de265_flush_data
.
argtypes
=
[
ctypes
.
c_void_p
]
libde265
.
de265_flush_data
.
restype
=
ctypes
.
c_int
...
...
@@ -114,6 +115,9 @@ libde265.de265_decode.restype = ctypes.c_int
libde265
.
de265_get_next_picture
.
argtypes
=
[
ctypes
.
c_void_p
]
libde265
.
de265_get_next_picture
.
restype
=
ctypes
.
c_void_p
libde265
.
de265_release_next_picture
.
argtypes
=
[
ctypes
.
c_void_p
]
libde265
.
de265_release_next_picture
.
restype
=
None
libde265
.
de265_get_image_width
.
argtypes
=
[
ctypes
.
c_void_p
,
ctypes
.
c_int
]
libde265
.
de265_get_image_width
.
restype
=
ctypes
.
c_int
...
...
@@ -126,6 +130,11 @@ libde265.de265_get_bits_per_pixel.restype = ctypes.c_int
libde265
.
de265_get_image_plane
.
argtypes
=
[
ctypes
.
c_void_p
,
ctypes
.
c_int
,
ctypes
.
POINTER
(
ctypes
.
c_int
)]
libde265
.
de265_get_image_plane
.
restype
=
ctypes
.
POINTER
(
ctypes
.
c_char
)
libde265
.
de265_get_number_of_input_bytes_pending
.
argtypes
=
[
ctypes
.
c_void_p
]
libde265
.
de265_get_number_of_input_bytes_pending
.
restype
=
ctypes
.
c_int
import
time
class
Decoder
:
def
__init__
(
self
,
size
,
threads
=
_threads
):
self
.
_size
=
size
...
...
@@ -169,7 +178,10 @@ class Decoder:
def
decode
(
self
):
err
=
libde265
.
de265_decode
(
self
.
_ctx
,
self
.
_more
)
if
err
and
err
!=
libde265error
.
DE265_ERROR_WAITING_FOR_INPUT_DATA
:
# if err and err != libde265error.DE265_ERROR_WAITING_FOR_INPUT_DATA:
# Does this happen? Should use custom exception.
if
err
:
raise
Exception
(
self
.
get_error_str
(
err
))
return
self
.
_more
.
value
!=
0
...
...
@@ -185,6 +197,7 @@ class Decoder:
Returns next decoded frame. Image in YCbCr format. If no frame available
returns None.
'''
img
=
libde265
.
de265_get_next_picture
(
self
.
_ctx
)
if
not
img
:
...
...
@@ -208,4 +221,6 @@ class Decoder:
res
[:,:,
c
]
=
_resize
(
ch
,
self
.
_size
)
libde265
.
de265_release_next_picture
(
self
.
_ctx
)
return
res
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment