2
* camapplication.h - GStreamer CAM (EN50221) Application Layer
3
* Copyright (C) 2007 Alessandro Decina
6
* Alessandro Decina <alessandro@nnva.org>
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Library General Public
10
* License as published by the Free Software Foundation; either
11
* version 2 of the License, or (at your option) any later version.
13
* This library is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Library General Public License for more details.
18
* You should have received a copy of the GNU Library General Public
19
* License along with this library; if not, write to the
20
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21
* Boston, MA 02111-1307, USA.
24
#ifndef CAM_APPLICATION_LAYER_H
25
#define CAM_APPLICATION_LAYER_H
28
#include "camsession.h"
30
#define CAM_AL(obj) ((CamAL *) obj)
31
#define CAM_AL_APPLICATION(obj) ((CamALApplication *) obj)
33
#define CAM_AL_RESOURCE_ID_IS_PUBLIC(resource_id) ((resource_id >> 30) != 3)
34
#define CAM_AL_RESOURCE_ID_CLASS(resource_id) ((resource_id >> 16) & 0x3FFF)
35
#define CAM_AL_RESOURCE_ID_TYPE(resource_id) ((resource_id >> 6) & 0x03FF)
36
#define CAM_AL_RESOURCE_ID_VERSION(resource_id) (resource_id & 0x3F)
38
#define CAM_AL_RESOURCE_MANAGER_ID 0x10041
39
#define CAM_AL_APPLICATION_INFO_ID 0x20041
40
#define CAM_AL_CONDITIONAL_ACCESS_ID 0x30041
42
typedef struct _CamAL CamAL;
43
typedef struct _CamALApplication CamALApplication;
49
GHashTable *applications;
52
struct _CamALApplication
59
CamReturn (*session_request) (CamALApplication *application,
60
CamSLSession *session, CamSLResourceStatus *status);
61
CamReturn (*open) (CamALApplication *application, CamSLSession *session);
62
CamReturn (*close) (CamALApplication *application, CamSLSession *session);
63
CamReturn (*data) (CamALApplication *application, CamSLSession *session,
64
guint tag, guint8 *buffer, guint length);
67
CamAL *cam_al_new (CamSL *sl);
68
void cam_al_destroy (CamAL *al);
70
gboolean cam_al_install (CamAL *al, CamALApplication *application);
71
gboolean cam_al_uninstall (CamAL *al, CamALApplication *application);
72
CamALApplication *cam_al_get (CamAL *al, guint resource_id);
73
GList *cam_al_get_resource_ids (CamAL *al);
75
void cam_al_calc_buffer_size (CamAL *al, guint body_length,
76
guint *buffer_size, guint *offset);
78
void _cam_al_application_init (CamALApplication *application);
79
void _cam_al_application_destroy (CamALApplication *application);
81
CamReturn cam_al_application_write (CamALApplication *application,
82
CamSLSession *session, guint tag, guint8 *buffer,
83
guint buffer_size, guint body_length);
84
#endif /* CAM_APPLICATION_LAYER_H */