mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
Added binder_session param to nwindowCreate(), which is now used with the binderInitSession() call instead of a hard-coded Service. Moved the viGetSession_IHOSBinderDriverRelay() call into nwindowCreateFromLayer(), for this new param.
This commit is contained in:
parent
5e535bc2eb
commit
bde3ae5a77
@ -58,10 +58,11 @@ NWindow* nwindowGetDefault(void);
|
|||||||
/**
|
/**
|
||||||
* @brief Creates a \ref NWindow.
|
* @brief Creates a \ref NWindow.
|
||||||
* @param[out] nw Output \ref NWindow structure.
|
* @param[out] nw Output \ref NWindow structure.
|
||||||
|
* @param[in] binder_session Service object for the Android IGraphicBufferProducer binder session.
|
||||||
* @param[in] binder_id Android IGraphicBufferProducer binder session ID.
|
* @param[in] binder_id Android IGraphicBufferProducer binder session ID.
|
||||||
* @param[in] producer_controlled_by_app Specifies whether the producer is controlled by the application.
|
* @param[in] producer_controlled_by_app Specifies whether the producer is controlled by the application.
|
||||||
*/
|
*/
|
||||||
Result nwindowCreate(NWindow* nw, s32 binder_id, bool producer_controlled_by_app);
|
Result nwindowCreate(NWindow* nw, Service* binder_session, s32 binder_id, bool producer_controlled_by_app);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Creates a \ref NWindow operating on a \ref ViLayer.
|
* @brief Creates a \ref NWindow operating on a \ref ViLayer.
|
||||||
|
@ -48,7 +48,7 @@ bool nwindowIsValid(NWindow* nw)
|
|||||||
return nw && nw->magic == NWINDOW_MAGIC;
|
return nw && nw->magic == NWINDOW_MAGIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result nwindowCreate(NWindow* nw, s32 binder_id, bool producer_controlled_by_app)
|
Result nwindowCreate(NWindow* nw, Service* binder_session, s32 binder_id, bool producer_controlled_by_app)
|
||||||
{
|
{
|
||||||
Result rc;
|
Result rc;
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ Result nwindowCreate(NWindow* nw, s32 binder_id, bool producer_controlled_by_app
|
|||||||
nw->producer_controlled_by_app = producer_controlled_by_app;
|
nw->producer_controlled_by_app = producer_controlled_by_app;
|
||||||
|
|
||||||
binderCreate(&nw->bq, binder_id);
|
binderCreate(&nw->bq, binder_id);
|
||||||
rc = binderInitSession(&nw->bq, viGetSession_IHOSBinderDriverRelay());
|
rc = binderInitSession(&nw->bq, binder_session);
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc))
|
if (R_SUCCEEDED(rc))
|
||||||
binderGetNativeHandle(&nw->bq, 0x0f, &nw->event);
|
binderGetNativeHandle(&nw->bq, 0x0f, &nw->event);
|
||||||
@ -76,7 +76,7 @@ Result nwindowCreate(NWindow* nw, s32 binder_id, bool producer_controlled_by_app
|
|||||||
|
|
||||||
Result nwindowCreateFromLayer(NWindow* nw, const ViLayer* layer)
|
Result nwindowCreateFromLayer(NWindow* nw, const ViLayer* layer)
|
||||||
{
|
{
|
||||||
return nwindowCreate(nw, layer->igbp_binder_obj_id, false);
|
return nwindowCreate(nw, viGetSession_IHOSBinderDriverRelay(), layer->igbp_binder_obj_id, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nwindowClose(NWindow* nw)
|
void nwindowClose(NWindow* nw)
|
||||||
|
Loading…
Reference in New Issue
Block a user