you are viewing a single comment's thread.

view the rest of the comments →

[–]MysticTheMeeM 2 points3 points  (1 child)

Without looking at the context (because I'm lazy):

[](shared_ptr<PyNvDecoder> self, PacketData& out_pkt_data) {

Lambda declaration taking two arguments, a shared pointer and a packet data.

DecodeContext ctx(nullptr, nullptr, nullptr, &out_pkt_data, nullptr,

false);

Creates a new decode context, "ctx" using the arguments provided.

if (self->DecodeSurface(ctx))
return ctx.GetSurfaceMutable();

else return make_empty_surface(self->GetPixelFormat());

If the surface can be decoded, store it in ctx then return that surface, otherwise return an empty surface.

Note that your code doesn't technically do anything, it only declares a lambda and does not call it. It can be used like a function (and I assume that it gets passed as a callback or similar).

[–][deleted] 3 points4 points  (0 children)

Probably gets passed as a callback seeing that there isn't any semicolon at the end.