Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gst-devtools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thibault Saunier
gst-devtools
Commits
d06e3672
Commit
d06e3672
authored
Apr 21, 2020
by
Thibault Saunier
🌵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
validate: Add a test manager to run itu h264 conformance testsuites
parent
50ea0373
Pipeline
#219279
waiting for manual action with stages
in 39 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
104 additions
and
0 deletions
+104
-0
validate/launcher/apps/gstituh26xconformance.py
validate/launcher/apps/gstituh26xconformance.py
+104
-0
No files found.
validate/launcher/apps/gstituh26xconformance.py
0 → 100644
View file @
d06e3672
#!/usr/bin/env python3
#
# Copyright (c) 2020,Thibault Saunier <tsaunier@igalia.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
import
os
import
glob
import
hashlib
from
.apps.gstvalidate
import
GstValidateTestManager
,
GstValidateLaunchTest
,
GstValidatePipelineTestsGenerator
from
launcher.utils
import
get_fakesink_for_media_type
H264_PIPELINE
=
'filesrc location=%s ! h264parse ! %s ! video/x-raw,format=I420 ! %s'
class
GstITUH26XConformanceTest
(
GstValidateLaunchTest
):
def
get_subproc_env
(
self
):
# For some reason doting the pipeline changes the md5sum oO
env
=
super
().
get_subproc_env
()
del
env
[
'GST_DEBUG_DUMP_DOT_DIR'
]
return
env
class
GstITUH26XConformance
(
GstValidateTestManager
):
name
=
"ituh26x"
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
().
__init__
(
*
args
,
**
kwargs
)
self
.
extra_data
=
{}
self
.
h264_dirs
=
[]
def
init
(
self
):
return
True
def
add_options
(
self
,
parser
):
group
=
parser
.
add_argument_group
()
group
.
add_argument
(
"--ituh26x-h264-decoder"
,
dest
=
"ituh26x_h264_decoder"
,
default
=
"avdec_h264"
)
def
get_checksum
(
self
,
f
):
_dir
=
os
.
path
.
dirname
(
f
)
name
,
_
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
f
))
files
=
[]
for
f
in
glob
.
glob
(
os
.
path
.
join
(
_dir
,
"*.yuv"
)):
if
os
.
path
.
basename
(
f
).
startswith
(
name
):
files
.
append
(
f
)
if
len
(
files
)
!=
1
:
return
None
hash_md5
=
hashlib
.
md5
()
with
open
(
files
[
0
],
"rb"
)
as
f
:
for
chunk
in
iter
(
lambda
:
f
.
read
(
4096
),
b
""
):
hash_md5
.
update
(
chunk
)
return
hash_md5
.
hexdigest
()
def
list_tests
(
self
):
if
self
.
tests
:
return
self
.
tests
for
_dir
in
self
.
h264_dirs
:
for
root
,
_
,
files
in
os
.
walk
(
_dir
):
for
f
in
files
:
fname
,
ext
=
os
.
path
.
splitext
(
f
)
is_h264
=
ext
in
[
'.264'
,
'.jsv'
,
'.26l'
,
'.avc'
,
'.h264'
]
file_path
=
os
.
path
.
join
(
root
,
f
)
if
not
is_h264
:
continue
md5
=
self
.
get_checksum
(
file_path
)
if
not
md5
:
if
self
.
options
.
mute
:
sink
=
get_fakesink_for_media_type
(
"video"
,
False
)
else
:
sink
=
'autovideosink'
else
:
sink
=
"testsink expected-md5="
+
md5
sink
+=
" name=sink"
pipe
=
H264_PIPELINE
%
(
file_path
,
self
.
options
.
ituh26x_h264_decoder
,
sink
)
test_private_dir
=
os
.
path
.
join
(
self
.
options
.
privatedir
,
self
.
name
,
fname
)
test
=
GstITUH26XConformanceTest
(
"%s"
%
fname
,
self
.
options
,
self
.
reporter
,
pipe
,)
config_file
=
GstValidatePipelineTestsGenerator
.
get_config_file
(
[
"%(validateflow)s, pad=sink:sink, record-buffers=true, buffers-checksum=true"
],
test_private_dir
,
fname
,
self
.
extra_data
)
test
.
add_validate_config
(
config_file
)
self
.
add_test
(
test
)
return
self
.
tests
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment