[poppler] glib/demo glib/poppler-movie.cc glib/poppler-movie.h glib/reference NEWS
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sat May 9 22:55:12 UTC 2020
NEWS | 2 +-
glib/demo/utils.c | 3 +++
glib/poppler-movie.cc | 25 +++++++++++++++++++++++++
glib/poppler-movie.h | 2 ++
glib/reference/poppler-sections.txt | 3 ++-
5 files changed, 33 insertions(+), 2 deletions(-)
New commits:
commit e10d9cbbc45f2fe470a4da801cb84e85a34d37aa
Author: Evgeny Stambulchik <fnevgeny at gmail.com>
Date: Sat May 9 22:55:10 2020 +0000
glib: Add poppler_movie_get_aspect
diff --git a/NEWS b/NEWS
index a2c4d102..27abe7a8 100644
--- a/NEWS
+++ b/NEWS
@@ -170,7 +170,7 @@ Release 0.80.0:
glib:
* Make print scaling getter visible
* Make Duplex/NumCopies/PrintPageRange preference available in API
- * Implement Movie API
+ * Complement Movie API
utils:
* pdftotext: Add -nodiag flag to remove diagonal text on output
diff --git a/glib/demo/utils.c b/glib/demo/utils.c
index aad6c88c..2d754b09 100644
--- a/glib/demo/utils.c
+++ b/glib/demo/utils.c
@@ -563,6 +563,7 @@ pgd_movie_view_set_movie (GtkWidget *movie_view,
GtkWidget *table;
GtkWidget *button;
GEnumValue *enum_value;
+ gint width, height;
gint row = 0;
table = gtk_bin_get_child (GTK_BIN (movie_view));
@@ -597,6 +598,8 @@ pgd_movie_view_set_movie (GtkWidget *movie_view,
pgd_table_add_property (GTK_GRID (table), "<b>Start:</b>", g_strdup_printf("%g s", poppler_movie_get_start (movie)/1e9), &row);
pgd_table_add_property (GTK_GRID (table), "<b>Duration:</b>", g_strdup_printf("%g s", poppler_movie_get_duration (movie)/1e9), &row);
pgd_table_add_property (GTK_GRID (table), "<b>Rotation Angle:</b>", g_strdup_printf("%u", poppler_movie_get_rotation_angle (movie)), &row);
+ poppler_movie_get_aspect (movie, &width, &height);
+ pgd_table_add_property (GTK_GRID (table), "<b>Aspect:</b>", g_strdup_printf("%dx%d", width, height), &row);
button = gtk_button_new_with_mnemonic ("_Play");
g_signal_connect (button, "clicked",
diff --git a/glib/poppler-movie.cc b/glib/poppler-movie.cc
index 14b75e06..d9e9817a 100644
--- a/glib/poppler-movie.cc
+++ b/glib/poppler-movie.cc
@@ -44,6 +44,8 @@ struct _PopplerMovie
guint64 start;
guint64 duration;
gushort rotation_angle;
+ gint width;
+ gint height;
};
struct _PopplerMovieClass
@@ -138,6 +140,8 @@ _poppler_movie_new (const Movie *poppler_movie)
movie->rotation_angle = poppler_movie->getRotationAngle();
+ poppler_movie->getAspect(&movie->width, &movie->height);
+
return movie;
}
@@ -325,3 +329,24 @@ poppler_movie_get_duration (PopplerMovie *poppler_movie)
return poppler_movie->duration;
}
+
+/**
+ * poppler_movie_get_aspect:
+ * @poppler_movie: a #PopplerMovie
+ * @width: width of the movie's bounding box
+ * @height: height of the movie's bounding box
+ *
+ * Returns the dimensions of the movie's bounding box (in pixels).
+ * The respective PDF movie dictionary entry is optional; if missing,
+ * -1x-1 will be returned.
+ *
+ * Since: 0.89
+ */
+void
+poppler_movie_get_aspect (PopplerMovie *poppler_movie, gint *width, gint *height)
+{
+ g_return_if_fail (POPPLER_IS_MOVIE (poppler_movie));
+
+ *width = poppler_movie->width;
+ *height = poppler_movie->height;
+}
diff --git a/glib/poppler-movie.h b/glib/poppler-movie.h
index 9350a073..c213321e 100644
--- a/glib/poppler-movie.h
+++ b/glib/poppler-movie.h
@@ -73,6 +73,8 @@ POPPLER_PUBLIC
guint64 poppler_movie_get_start (PopplerMovie *poppler_movie);
POPPLER_PUBLIC
guint64 poppler_movie_get_duration (PopplerMovie *poppler_movie);
+POPPLER_PUBLIC
+void poppler_movie_get_aspect (PopplerMovie *poppler_movie, gint *width, gint *height);
G_END_DECLS
diff --git a/glib/reference/poppler-sections.txt b/glib/reference/poppler-sections.txt
index 596a872c..65e4ad99 100644
--- a/glib/reference/poppler-sections.txt
+++ b/glib/reference/poppler-sections.txt
@@ -586,6 +586,7 @@ poppler_media_get_type
<TITLE>Poppler Movie</TITLE>
PopplerMovie
PopplerMoviePlayMode
+poppler_movie_get_aspect
poppler_movie_get_duration
poppler_movie_get_filename
poppler_movie_get_play_mode
@@ -593,9 +594,9 @@ poppler_movie_get_rate
poppler_movie_get_rotation_angle
poppler_movie_get_start
poppler_movie_get_volume
+poppler_movie_is_synchronous
poppler_movie_need_poster
poppler_movie_show_controls
-poppler_movie_is_synchronous
<SUBSECTION Standard>
POPPLER_MOVIE
More information about the poppler
mailing list