summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-08-26 10:24:39 +0200
committerMiklos Vajna <vmiklos@collabora.com>2022-08-29 15:29:58 +0200
commit6894da107db06c66356e52844c4a8d263e0a64d8 (patch)
tree8ed7aa540f952303818ad4c4a8c6114848220aa5 /svx
parent2a0c3f70aca0493f334d2af59a2dc23727e571ff (diff)
tdf#149971 avmedia: implement video crop support in the gsteamer backend
If a media shape had cropping defined, we already took that into account when presenting a preview for it, but not during video playback. The reason for this is that the preview may be set by a file importer (e.g. PPTX) explicitly, in which case the preview is a bitmap we get without any video processing. As a start, implement video crop for the gstreamer backend (used on Linux), and also pass in the media item (containing crop and other properties) both during the edit view (MediaWindowImpl) and presenting (ViewMediaShape). We pass in the whole media item, so in case later other filters (e.g. black-and-white) are wanted, we have all that info in the backends already. Other backends (avmediaMacAVF and avmediawin) are untouched so far. svx/qa/unit/data/video-snapshot.pptx is modified to have a yellow border when cropping is unimplemented, which is now not visible with the gtreamer backend, matching PowerPoint behavior. PPTX export was working out of the box already. (cherry picked from commit 916848d877a788d02e2e7c980872314839101798) Conflicts: avmedia/source/viewer/mediawindow_impl.cxx Change-Id: If26b7a4391bcffe9cbddd9933e1bab69be52924e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138969 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/qa/unit/data/video-snapshot.pptxbin40759 -> 40331 bytes
-rw-r--r--svx/qa/unit/svdraw.cxx4
2 files changed, 2 insertions, 2 deletions
diff --git a/svx/qa/unit/data/video-snapshot.pptx b/svx/qa/unit/data/video-snapshot.pptx
index a212f105200f..76f7c0d503e6 100644
--- a/svx/qa/unit/data/video-snapshot.pptx
+++ b/svx/qa/unit/data/video-snapshot.pptx
Binary files differ
diff --git a/svx/qa/unit/svdraw.cxx b/svx/qa/unit/svdraw.cxx
index 66400c375cf1..58d01e7f8905 100644
--- a/svx/qa/unit/svdraw.cxx
+++ b/svx/qa/unit/svdraw.cxx
@@ -490,9 +490,9 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testVideoSnapshot)
// Without the accompanying fix in place, this test would have failed with:
// - Expected: rgba[ff0000ff]
// - Actual : rgba[000000ff]
- // i.e. the preview was black, not red; since we seeked 3 secs into the video, while PowerPoint
+ // i.e. the preview was black, not ~red; since we seeked 3 secs into the video, while PowerPoint
// doesn't do that.
- CPPUNIT_ASSERT_EQUAL(Color(0xff, 0x0, 0x0), rBitmap.GetPixelColor(0, 0));
+ CPPUNIT_ASSERT_EQUAL(Color(0xfe, 0x0, 0x0), rBitmap.GetPixelColor(0, 0));
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 321