[libdvdnav-devel] [Git][videolan/libdvdnav][master] add dvdnav_get_video_format()

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Fri Aug 21 17:39:42 UTC 2026



Jean-Baptiste Kempf pushed to branch master at VideoLAN / libdvdnav


Commits:
aca6a45c by Scott Theisen at 2026-08-11T13:56:02-04:00
add dvdnav_get_video_format()

from:
https://github.com/MythTV/mythtv/commit/7d56f0efb96305064f11575219512c0ce1b9314b

- - - - -


4 changed files:

- src/dvdnav.c
- src/dvdnav/dvdnav.h
- src/vm/vm.h
- src/vm/vmget.c


Changes:

=====================================
src/dvdnav.c
=====================================
@@ -1024,6 +1024,25 @@ uint8_t dvdnav_get_video_scale_permission(dvdnav_t *this) {
   return retval;
 }
 
+uint8_t dvdnav_get_video_format(dvdnav_t *this) {
+  uint8_t         retval;
+
+  if(!this) {
+    printerr("Passed a NULL pointer.");
+    return -1;
+  }
+  if(!this->started) {
+   printerr("Virtual DVD machine not started.");
+   return -1;
+  }
+
+  pthread_mutex_lock(&this->vm_lock);
+  retval = (uint8_t)vm_get_video_format(this->vm);
+  pthread_mutex_unlock(&this->vm_lock);
+
+  return retval;
+}
+
 uint16_t dvdnav_audio_stream_to_lang(dvdnav_t *this, uint8_t stream) {
   audio_attr_t  attr;
 


=====================================
src/dvdnav/dvdnav.h
=====================================
@@ -658,6 +658,12 @@ DVDNAV_API dvdnav_status_t dvdnav_get_video_resolution(dvdnav_t *self, uint32_t
  */
 DVDNAV_API uint8_t dvdnav_get_video_scale_permission(dvdnav_t *self);
 
+/*
+* Get video format
+* 0 - NTSC , 1 - PAL
+*/
+DVDNAV_API uint8_t dvdnav_get_video_format(dvdnav_t *self);
+
 /*
  * Converts a *logical* audio stream id into language code
  * (returns 0xffff if no such stream).


=====================================
src/vm/vm.h
=====================================
@@ -159,6 +159,7 @@ void vm_get_subp_info(vm_t *vm, int *current, int *num_avail);
 void vm_get_video_res(vm_t *vm, int *width, int *height);
 int  vm_get_video_aspect(vm_t *vm);
 int  vm_get_video_scale_permission(vm_t *vm);
+int  vm_get_video_format(vm_t *vm);
 video_attr_t vm_get_video_attr(vm_t *vm);
 audio_attr_t vm_get_audio_attr(vm_t *vm, int streamN);
 subp_attr_t  vm_get_subp_attr(vm_t *vm, int streamN);


=====================================
src/vm/vmget.c
=====================================
@@ -310,6 +310,10 @@ int vm_get_video_scale_permission(vm_t *vm) {
   return vm_get_video_attr(vm).permitted_df;
 }
 
+int vm_get_video_format(vm_t *vm) {
+  return vm_get_video_attr(vm).video_format;
+}
+
 video_attr_t vm_get_video_attr(vm_t *vm) {
   switch ((vm->state).domain) {
   case DVD_DOMAIN_VTSTitle:



View it on GitLab: https://code.videolan.org/videolan/libdvdnav/-/commit/aca6a45cf16a261eb563b5020e94f1a63a59bc29

-- 
View it on GitLab: https://code.videolan.org/videolan/libdvdnav/-/commit/aca6a45cf16a261eb563b5020e94f1a63a59bc29
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the libdvdnav-devel mailing list