Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
b80a4563
Commit
b80a4563
authored
Aug 05, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib: merge event_internal.h into event.c
parent
062bd6c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
109 deletions
+70
-109
lib/Makefile.am
lib/Makefile.am
+0
-1
lib/event.c
lib/event.c
+70
-5
lib/event_internal.h
lib/event_internal.h
+0
-103
No files found.
lib/Makefile.am
View file @
b80a4563
...
...
@@ -32,7 +32,6 @@ lib_LTLIBRARIES = libvlc.la
libvlc_la_SOURCES
=
\
libvlc_internal.h
\
event_internal.h
\
media_internal.h
\
media_list_internal.h
\
media_player_internal.h
\
...
...
lib/event.c
View file @
b80a4563
...
...
@@ -26,14 +26,79 @@
# include "config.h"
#endif
#define LIBVLC_EVENT_TYPES_KEEP_DEFINE
#include <vlc/libvlc.h>
#include "libvlc_internal.h"
#include "event_internal.h"
#include <assert.h>
#include <errno.h>
#include <vlc/libvlc.h>
#include "libvlc_internal.h"
#include <vlc_common.h>
/*
* Event Handling
*/
/* Example usage
*
* struct libvlc_cool_object_t
* {
* ...
* libvlc_event_manager_t * p_event_manager;
* ...
* }
*
* libvlc_my_cool_object_new()
* {
* ...
* p_self->p_event_manager = libvlc_event_manager_new( p_self )
* libvlc_event_manager_register_event_type(p_self->p_event_manager,
* libvlc_MyCoolObjectDidSomething, p_e)
* ...
* }
*
* libvlc_my_cool_object_release()
* {
* ...
* libvlc_event_manager_release( p_self->p_event_manager );
* ...
* }
*
* libvlc_my_cool_object_do_something()
* {
* ...
* libvlc_event_t event;
* event.type = libvlc_MyCoolObjectDidSomething;
* event.u.my_cool_object_did_something.what_it_did = kSomething;
* libvlc_event_send( p_self->p_event_manager, &event );
* }
* */
typedef
struct
libvlc_event_listener_t
{
libvlc_event_type_t
event_type
;
void
*
p_user_data
;
libvlc_callback_t
pf_callback
;
}
libvlc_event_listener_t
;
typedef
struct
libvlc_event_manager_t
{
void
*
p_obj
;
vlc_array_t
listeners_groups
;
vlc_mutex_t
object_lock
;
vlc_mutex_t
event_sending_lock
;
}
libvlc_event_sender_t
;
static
inline
bool
listeners_are_equal
(
libvlc_event_listener_t
*
listener1
,
libvlc_event_listener_t
*
listener2
)
{
return
listener1
->
event_type
==
listener2
->
event_type
&&
listener1
->
pf_callback
==
listener2
->
pf_callback
&&
listener1
->
p_user_data
==
listener2
->
p_user_data
;
}
typedef
struct
libvlc_event_listeners_group_t
{
libvlc_event_type_t
event_type
;
...
...
lib/event_internal.h
deleted
100644 → 0
View file @
062bd6c2
/*****************************************************************************
* event_internal.h : Definition of opaque structures for libvlc exported API
* Also contains some internal utility functions
*****************************************************************************
* Copyright (C) 2005-2009 VLC authors and VideoLAN
* $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef _LIBVLC_EVENT_H
#define _LIBVLC_EVENT_H 1
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc/libvlc_structures.h>
#include <vlc/libvlc.h>
#include <vlc/libvlc_events.h>
#include <vlc_common.h>
/*
* Event Handling
*/
/* Example usage
*
* struct libvlc_cool_object_t
* {
* ...
* libvlc_event_manager_t * p_event_manager;
* ...
* }
*
* libvlc_my_cool_object_new()
* {
* ...
* p_self->p_event_manager = libvlc_event_manager_new( p_self )
* libvlc_event_manager_register_event_type(p_self->p_event_manager,
* libvlc_MyCoolObjectDidSomething, p_e)
* ...
* }
*
* libvlc_my_cool_object_release()
* {
* ...
* libvlc_event_manager_release( p_self->p_event_manager );
* ...
* }
*
* libvlc_my_cool_object_do_something()
* {
* ...
* libvlc_event_t event;
* event.type = libvlc_MyCoolObjectDidSomething;
* event.u.my_cool_object_did_something.what_it_did = kSomething;
* libvlc_event_send( p_self->p_event_manager, &event );
* }
* */
typedef
struct
libvlc_event_listener_t
{
libvlc_event_type_t
event_type
;
void
*
p_user_data
;
libvlc_callback_t
pf_callback
;
}
libvlc_event_listener_t
;
typedef
struct
libvlc_event_manager_t
{
void
*
p_obj
;
vlc_array_t
listeners_groups
;
vlc_mutex_t
object_lock
;
vlc_mutex_t
event_sending_lock
;
}
libvlc_event_sender_t
;
static
inline
bool
listeners_are_equal
(
libvlc_event_listener_t
*
listener1
,
libvlc_event_listener_t
*
listener2
)
{
return
listener1
->
event_type
==
listener2
->
event_type
&&
listener1
->
pf_callback
==
listener2
->
pf_callback
&&
listener1
->
p_user_data
==
listener2
->
p_user_data
;
}
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment