"fullscreen",\r
"height",\r
"width",\r
- "aspectRatio"\r
+ "aspectRatio",\r
+ "crop"\r
};\r
\r
enum LibvlcVideoNPObjectPropertyIds\r
ID_video_fullscreen,\r
ID_video_height,\r
ID_video_width,\r
- ID_video_aspectratio\r
+ ID_video_aspectratio,\r
+ ID_video_crop\r
};\r
\r
const int LibvlcVideoNPObject::propertyCount = sizeof(LibvlcVideoNPObject::propertyNames)/sizeof(NPUTF8 *);\r
STRINGZ_TO_NPVARIANT(psz_aspect, result);\r
return INVOKERESULT_NO_ERROR;\r
}\r
+ case ID_video_crop:\r
+ {\r
+ NPUTF8 *psz_geometry = libvlc_video_get_crop_geometry(p_input, &ex);\r
+ libvlc_input_free(p_input);\r
+ if( libvlc_exception_raised(&ex) )\r
+ {\r
+ NPN_SetException(this, libvlc_exception_get_message(&ex));\r
+ libvlc_exception_clear(&ex);\r
+ return INVOKERESULT_GENERIC_ERROR;\r
+ }\r
+ if( !psz_geometry )\r
+ return INVOKERESULT_GENERIC_ERROR;\r
+\r
+ STRINGZ_TO_NPVARIANT(psz_geometry, result);\r
+ return INVOKERESULT_NO_ERROR;\r
+ }\r
}\r
libvlc_input_free(p_input);\r
}\r
int val = NPVARIANT_TO_BOOLEAN(value);\r
libvlc_set_fullscreen(p_input, val, &ex);\r
libvlc_input_free(p_input);\r
+\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
}\r
\r
libvlc_video_set_aspect_ratio(p_input, psz_aspect, &ex);\r
- if( psz_aspect )\r
- free(psz_aspect );\r
+ free(psz_aspect );\r
+ libvlc_input_free(p_input);\r
+\r
+ if( libvlc_exception_raised(&ex) )\r
+ {\r
+ NPN_SetException(this, libvlc_exception_get_message(&ex));\r
+ libvlc_exception_clear(&ex);\r
+ return INVOKERESULT_GENERIC_ERROR;\r
+ }\r
+ return INVOKERESULT_NO_ERROR;\r
+ }\r
+ case ID_video_crop:\r
+ {\r
+ char *psz_geometry = NULL;\r
+\r
+ if( ! NPVARIANT_IS_STRING(value) )\r
+ {\r
+ libvlc_input_free(p_input);\r
+ return INVOKERESULT_INVALID_VALUE;\r
+ }\r
\r
+ psz_geometry = stringValue(NPVARIANT_TO_STRING(value));\r
+ if( !psz_geometry )\r
+ {\r
+ libvlc_input_free(p_input);\r
+ return INVOKERESULT_GENERIC_ERROR;\r
+ }\r
+\r
+ libvlc_video_set_crop_geometry(p_input, psz_geometry, &ex);\r
+ free(psz_geometry );\r
libvlc_input_free(p_input);\r
+\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r