mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-14 05:12:09 +00:00
playback/player: android: Cast pointers to gintptr to simplify code
This commit is contained in:
parent
5035124050
commit
8b41422c77
1 changed files with 2 additions and 11 deletions
|
@ -30,17 +30,8 @@
|
|||
GST_DEBUG_CATEGORY_STATIC (debug_category);
|
||||
#define GST_CAT_DEFAULT debug_category
|
||||
|
||||
/*
|
||||
* These macros provide a way to store the native pointer to Player, which might be 32 or 64 bits, into
|
||||
* a jlong, which is always 64 bits, without warnings.
|
||||
*/
|
||||
#if GLIB_SIZEOF_VOID_P == 8
|
||||
# define GET_CUSTOM_DATA(env, thiz, fieldID) (Player *)(*env)->GetLongField (env, thiz, fieldID)
|
||||
# define SET_CUSTOM_DATA(env, thiz, fieldID, data) (*env)->SetLongField (env, thiz, fieldID, (jlong)data)
|
||||
#else
|
||||
# define GET_CUSTOM_DATA(env, thiz, fieldID) (Player *)(jint)(*env)->GetLongField (env, thiz, fieldID)
|
||||
# define SET_CUSTOM_DATA(env, thiz, fieldID, data) (*env)->SetLongField (env, thiz, fieldID, (jlong)(jint)data)
|
||||
#endif
|
||||
#define GET_CUSTOM_DATA(env, thiz, fieldID) (Player *)(gintptr)(*env)->GetLongField (env, thiz, fieldID)
|
||||
#define SET_CUSTOM_DATA(env, thiz, fieldID, data) (*env)->SetLongField (env, thiz, fieldID, (jlong)(gintptr)data)
|
||||
|
||||
typedef struct _Player
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue