]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/VideoView.m
macosx/CAS: implement basic error checking for the stream-out settings
[vlc] / modules / gui / macosx / VideoView.m
index ac66812bdc5100869864fbe0505f4cb52eb42e28..cd88942d5f47d1a5c05ae25589062607147898f6 100644 (file)
@@ -51,6 +51,9 @@
 
 - (void)dealloc
 {
+    if (p_vout)
+        vlc_object_release(p_vout);
+
     [self unregisterDraggedTypes];
     [super dealloc];
 }
         key = [[characters lowercaseString] characterAtIndex: 0];
 
         if (key) {
-            vout_thread_t * p_vout = getVout();
             /* Escape should always get you out of fullscreen */
             if (key == (unichar) 0x1b) {
                 playlist_t * p_playlist = pl_Get(VLCIntf);
             else
                 msg_Dbg(VLCIntf, "could not send keyevent to VLC core");
 
-            if (p_vout)
-                vlc_object_release(p_vout);
-
             return;
         }
     }
         i_yvlckey = KEY_MOUSEWHEELDOWN;
     else
         i_yvlckey = KEY_MOUSEWHEELUP;
-    
+
     if (f_deltaX < 0.0f)
         i_xvlckey = KEY_MOUSEWHEELRIGHT;
     else
     }
 }
 
+#pragma mark -
+#pragma mark Handling of vout related actions
+
+- (void)setVoutThread:(vout_thread_t *)p_vout_thread
+{
+    assert(p_vout == NULL);
+    p_vout = p_vout_thread;
+    vlc_object_hold(p_vout);
+}
+
+- (vout_thread_t *)voutThread
+{
+    if (p_vout) {
+        vlc_object_hold(p_vout);
+        return p_vout;
+    }
+
+    return NULL;
+}
+
+- (void)releaseVoutThread
+{
+    if (p_vout) {
+        vlc_object_release(p_vout);
+        p_vout = NULL;
+    }
+}
+
+#pragma mark -
+#pragma mark Basic view behaviour and touch events handling
+
 - (BOOL)mouseDownCanMoveWindow
 {
     return YES;