Skip to content

Commit

Permalink
[ffmpeg-qsv] add jpeg encode playback_seek test case
Browse files Browse the repository at this point in the history
Signed-off-by: Wang Hangjie <[email protected]>
  • Loading branch information
Hangjie22Coder authored and uartie committed Oct 14, 2024
1 parent d7cf0cf commit 65105dd
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,19 @@ def gen_jpeg_cqp_parameters(spec):
params = gen_jpeg_cqp_variants(spec)
return keys, params

def gen_jpeg_seek_variants(spec):
for case, params in spec.items():
variants = params.get("variants", dict()).get("seek", [])
for variant in variants:
yield [
case, variant.get("fps", 25), variant.get("seek", 1)
]

def gen_jpeg_seek_parameters(spec):
keys = ("case", "fps", "seek")
params = gen_jpeg_seek_variants(spec)
return keys, params

def gen_vp8_cqp_variants(spec):
for case, params in spec.items():
variants = params.get("variants", dict()).get("cqp", None)
Expand Down
15 changes: 15 additions & 0 deletions test/ffmpeg-qsv/encode/jpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,18 @@ def test_r2r(self, case, quality):
self.init(spec_r2r, case, quality)
vars(self).setdefault("r2r", 5)
self.encode()

class seek(JPEGEncoderTest):
def init(self, tspec, case, fps, seek):
vars(self).update(tspec[case].copy())
vars(self).update(
case = case,
rcmode = "cqp",
fps = fps,
seek = seek,
)

@slash.parametrize(*gen_jpeg_seek_parameters(spec))
def test(self, case, fps, seek):
self.init(spec, case, fps, seek)
self.encode()

0 comments on commit 65105dd

Please sign in to comment.