 what it is and If you want to have it to use it or extend applications that use it. I hope you can have some insights about How much work is needed? After this presentation, so that's my goal And so first of all what is grillo? Yeah, so Two things that you you must keep in mind about thinking thinking about grillo. It's a multimedia framework Its purpose is to get their content and metadata so you can Look for videos image any kind of metadata or content for multimedia applications And the second thing is that it is pluggable. So how it's this work is done through plugins One of the great advantages is that it's very easy to extend and make new plugins new sources so on Yeah, this first part of the presentation I want to kind of showcase a little bit about How grillo is being used and mostly in the desktop in genome So it gets easier to understand Its purpose and how it's being used and so on Yeah, so this is Genome videos or totem it has two interface. I don't know if you can see well enough. I Can open it afterwards anyway So yeah, so you can see here. There is this basic interface. It's in these channels in genome videos So there is this upper side. You can try to search through any kind of plugging or you can browse them So you can browse through any kind of Plugins that you have available in my case. I don't think I have many but for instance Browsing Apple trailers You can see like I scrolled a little bit already and you can see like the some videos And play them and you can get them thumbnails name the length of the video So all of this is done by with grillo with some API calls You can have it all like just browsing Apple trailers You can get this on totem and totem. Of course, there is a widget for it and it fills it and For instance search Yeah, so for instance, I was searching mr. Robot, which is a cool series. You should check it out Yeah, then it shows like the whole the whole feed that I could get from YouTube itself in a browser Here for X for instance is written in box The interface is obviously different. I am browsing Jamando, it's a another web source for music Here I am browsing so Jamando in in feeds in top albums I'm playing some music of the best albums on the albums that they have there You can search as well. There is an interface there for search So basically I just show it to operations that you can do for with grillo like searching and browsing But the point is in different kinds of applications, right in different kind of plug-in sources But one of the things that I find more I'm using more cool in grillo is that you can just gather meta data meta data So we have like this thief movie and you want the thumbnail you want the subtitles You want like who works on it cast and so on so if you know some sort of source like I don't know emdb and You want to get all this information from there and put in your application so grillo can do it very nicely Yeah, so I want you Before going to the next part. I want you just a little bit explain how how this part works So totem is the application here then there is the blue Part I would say like this is how grillo and then the green part is the plugins so This interface that I just show you use for plugins The video to video title parsing that in this case is the only one written in Lua I will open the source code afterwards to show how it's done The TV DB for TV shows so it gets like the cast or the director or so on TMDB which is used for movies and open subititles plugins So you can get the subitles for that movie or that TV show that you want to see how it works So totem asks grillo Grillo, I have the file name of this Movie, can you get me some information for it and then video it will pass through video Tito parsing Which is the plug-in that says I can handle it from a file name. I can give you this information and Video Tito parsing does it if it does successfully it will get to grillo back and with the in case of a movie It's the year. It's the name of the movie If it's a TV show we can maybe show the season episode the name of the TV show and so on and Then yeah totem it That's not just what totem wants, right? He wants like the thumbnails he wants the the cast and so on so if it's like a TV show Grillo totem asks grillo give me everything that I want, right? So it will do through the two plugins at least in case of TV show TV DB or open subititles and Grillo will return him everything that it's necessary to pop up this interface and play the video for you With all that you need so this is more likely the workflow of it and Yeah, very interesting the second part. I want to like Pass through a little bit like I want to show you how Grillo Works a little bit, but they will not go in deep details on it if you have any questions feel free We can dive in it if you want But my main point is like the goal I said it's like give you an overview and how it works And what you can do and how much work you need if you want to use it and extend it and so on so If you are using grillo the common application flow It's just this for you just have it like you have already the plugins Outside their application. So all you need is loaded them load them Then there are applications that need to some sort of configuration like username password API key or so on so this kind of things the application can configure and give it nicely I think you saw it in Totten. I had my Pocket with my username and so on so it was configured Already and then you'll have to activate Then it's read to be used So far any questions Yeah, so this is a sample. Yeah cool thing grillo grillo API is in C, but you there is some introspection You know music use it in Python. I think there are viola bindings for it as well So, yeah, there's several ways you can use it even the application level Yeah, so this is like as just a small example of how you can Configure the plugin so you can see in the first function The in case of YouTube you just need the API key that YouTube need provides you And then it's like generic right? It's not user user specifics, but generic So any application that needs to interact with YouTube needs this API key so you can set it and That's all like I'm not going deep in the hole All the objects that it can provide but if you have any question like the gorilla registry is the one that handles the plugins So everything related to the plugins go through it a gorilla config is like the the object for configuration And so on no no much mystery like we have a really good documentation It takes like just a few one hour. Maybe and you have you could understand everything And then the second function is the load plugins Like the most interesting part is the last function the gorilla registry load out plugins It will do it like with you call the configure before and then load it and that's that's basically it Yeah, so Operations that gorilla supports. I I've I told you search and browse I baby not was I was not clear with resolve actually So all that gathering metadata the operation that you do is resolve so you already have a video You already have some information you want more information So this operation to get more information from something that you already have is resolve So yeah, for instance, you have the file name. It's is already something and you want the thumbnail for that video or so Yeah, you use resolve gorilla also supports for more functions, which is remove and star Yeah, the idea is that like you are interacting with the some source and you may may want to remove some content from your remote source or even local and depends of the plugin or a star So both of them are I didn't show but they are quite similar An example of the search So yeah, you see again So in this case, I have the this part here There's this lower side grill source search is the function You can see like how it's defined up up there. You need the grill source in this case is Jamando you can get it with registry or there are plenty ways to do to have this Then you will search for rock for instance because you want rock music or so or rock our artists And then you have to create a list of the keys that you want Maybe not all of the keys that are provided by Jamando Maybe some keys are provided by all their source and this is one of the coolest things in Grillo if If you want something like lyrics very common you want lyrics from music and Jamando does not provide it. It can look for other sources other plugins Hey, can you give me the lyrics for this music and it will return in the same callback for you if it's If it's it find it, okay? So yeah source the text you want to search the keys that you want some options So there are some examples there like yeah, I want five five results I want Like I want you to resolve it in different ways like as fast as possible. It's possible just local Remote so there are several options that you can set for for for it And then you pass the search callback some some user data and That's it when the Grillo pass will try to solve everything for you and call this callback back with Every every media like in this example. I'm trying to search for five elements. It will call this callback five times Yeah, basically each time is a new Grillo media. It can set the remaining Parameter so like you ask it for five or fifty, but it only have two Don't know so it will say oh you wanted five, but it only have two so you can check remaining The user data and yeah, this is a way that you can get the information from grill There is a whole API for each metadata. So you can get like Duration Grillo media get duration from the media get the ur URL for some video or so Yeah I this is the part of the search. I will not go into browse remove and store. They are really Really really similar like you have to pass like grill source browse and some content to it Then you it will browse like in the Jamando example You can pass browse new and you to return true elements, which is like the Forgot, but yeah, the top level of browsing then you can go like by artist second level and so on Remove store is the same thing you pass the Grillo media in that source what you want to store remove it's Yeah, so let's show some some example of What I want to show is exactly that that Interface from Totten that actually does not exist. It's a work in progress It's should be I should have finished it by now, but yeah, but yeah, I didn't So I'll show it a little bit now First of all how it's currently How is it currently right? Don't know which way is better. No I just like a basic interface. I Just fill it this it look into internet to get actually did not so the in case of TV shows There is a database a cache locally for for this for the plug-in. So it didn't even look into the Into the internet to get this information because I did it before But the internet here is very good. So it would do very fast Like three examples breaking bad Limitless and let's see the source so, yeah You can see there is like the widget Which is Totten video summary and there is sample dot C, right? I will first of all show the sample dot C The sample dot C would be like Yeah, bigger bigger bigger enough or So let's see if I can There is just two functions right the main and set up grillo. Let's go up fast by man first Yeah, GTK each grilling it right some information related to widgets in the case of Totten. They prefer the dark team so Bastion fix it for me and Then you set up grillo Let's go through it So this widget it it uses Yeah, three just three I thought I said it before for because open subtitles is not upstream that yet So the branch there is a branch with the subtitles in this widget, but it's not here in this moment So there is just three plugins being loaded Actually it loads all of them, but it not does not activate them. It's a new API actually so First of all grillo config new because that all of them No, sorry the TV DB and TV TM DB like them for TV shows and movies They need an API key. So all I need to do is like create a new config key Set the API key that I want And I did a config to the registry. So when I activate it to pass through the plugin that config and Then it will load it correctly, right? And I Activate the plugin afterwards The second one TM DB because if it's a movie Same thing. It's a API key. I added I load the plugin and so on and then this one Lou of factory. So the thing is Lua integration is that All the sources are part of a plugin Let me explain that better So there is you have to understand two things a plugin. What is the implementation of a plugin and what is a source? I mentioned this a few times, but now it's the time to explain it. So a plugin for instance He can provide you several sources like he I don't know flicker You may have like three different accounts on flicker and you can flicker can give you back three Sources right one for each account That's not true with Lua That that that could not be done because in the case Lua factory is a plugin and each plugin is On source. So if I have flicker In Lua, it would be just one source. So in this so this is like I'm going a little bit Maybe deep enough Yeah, so that's why I just load in Lua factory and it what will happen It will load all the sources that I have in that case Which in the which the one I will be using is the video Tito parsing So, I don't know if I was clear do anyone have any questions. Yeah Okay, so the widgets. Yeah, so you can see that the widgets like a yeah, it's Like 800 lines, I guess it has like three resolve operations You can see it So I do sorry, it's here So I do there is a function to do the resolve by the TV DB a function to resolve by TM DB and a function to resolve by video Tito parsing But maybe it's interesting as well to get to the source So you can see here. I'm already using it, right? It's which is Yeah, you can see I'm using self brief video Tito parsed source, where is it where I set it here in the When I set the new so in the sample here which one that creates the the plug-in The the widget so when you create it in the in the need function there It will in the new function It will try to get all the sources that it the widget needs in this case realty mdb DTV DB and gorilla video Tito parsing, right and I save the sources to use later on and Yeah, and also some Metadata keys that are specific so in this case like the TV DB There is a specific K Which is the TV DB poster key and TM DB has the TM DB poster key and I needed to get it from registry So I do it everything here and afterwards is just the reserve call I'll show you now So first of all when you try to add the function it will try to resolve Video Tito parsing right the function is it's pretty the three of them are really similar You want to so to resolve the video Tito parsing and You create some options resolve it and you know you ask what you want So I don't know if the video is and TV show or not So I ask everything that I can't from that and the call back Will try to Understand if it's a movie or not So if it's a if I can get the show name which is specific for TV show Then I know it's a TV show. I set a bullion here for later use I set the content already to not make the UI stuck like waiting for several operations So it sets the name set the everything that I have and then I resolve by by TV DB, which is the same thing like I just ask again lots of information and Ask TV DB for those information like so it's basically the same thing and when I finish it I said the UI with it and so on Yeah, so far any questions any any doubts Yeah, if I can ask all of it No, it's not what I do Because the so for resolving it's there is an option Which is this resolve normal resolve normal this up this option It's just like I want from this source only There is resolve full and resolve full does exactly like that if that source does not have what I want It will try to get from other sources. So it's a it's a option flag, right? You can set before Yeah, before before the calling. Yeah before calling the function. I Answered yeah, any other questions so far Yeah, we'll have a scarf So going back to So yeah, so I showed you search browser is basically the same you can see like All of them is like Some basic call API calls, but the great great thing is That you don't have to care about what is going to happen in the plug-ins side, right? What does it use G zone? Does it need like some? Crazy stuff. No, I don't care I'm just doing some search if it's some configuration needed It's on the config level like in application starting it. So it's very I Like it very easily So I want to give you some overview about creating plugins But I'm not going to go into Valor and neither in C part Okay, because yeah, it would be like a bit boring go through all of them in my opinion But I will give like at least a some some comparison comparison So yeah, you can create three types of plugins in three languages for at the moment and C was the main one the Which is we started with C It's a G object. So there is lots of boilerplate if you want to just start writing the plug-in But yeah, it's all the benefits that you can have in Grillo the C can handle it because it was it's the main one And For instance creating multiple sources. I have the example of who PNP which is universal plug-in plug-in play So I was looking for instance in there during other talk My thought and I was seeing like some people that would had the ONA Server so I could like access some content from it Don't want to access it but so like you can have any different sources for It searches the network right and provides this to your application case taught and it's very nice It works out of the box. I don't need to do anything So see plugins the Lua sources as I mentioned Which is loaded by Lua factory and Valor actually I never touched Valor some other people here did it you know So why Lua? It was like one question that yeah The integration came like two three years ago Yeah, when I started because it was my first Google summer of code project on this having Lua integration And people ask it why but why not Python? Why not like a powerful language because we don't want like So heavy stuff on it. We want just some something light that can do some You can extend it if you want and I will show you that we did With some nice extensions it makes writing a plugin much faster nowadays So why not Python or not? Why not other language because Lua is just like enough. It's fast It's very easy to integrate with C Yeah, and you can see like Lua has lots of comparisons is a quite fast language yeah Definitely the the the the goal was having like less boilerplate than the job plugins in C and making the writing plugins more fun and faster We have some great some some helpers from Lua library that is part of the Lua factory plugin. So Yeah, we don't need to parse jzone. We don't need to parse XML on Lua like we need to see There's no way in Lua. We just like get this from a string and it creates a table for you I don't know if you know Lua, but table is like a one of the best things in Lua There is the go integration as well, which is stands for Genoma line account So you have like you know my line accounts in genome You can like type your username configure like pocket in my case YouTube or so on Flickr definitely and if it's integrated the plugins integrated is using goa genome line accounts It will pass this information to the source Lua source and out of the box will work Yeah, but it has its limitations so in the sense that for instance we Yeah, like we don't support at the moment they store and remove Operations in Grillo just because we are a still like Trying to improve it as much as you can having it is not hard But it's not some there wasn't any request to have it so far like you saw I mentioned the TV DB poster key So that's a metadata key that they plug in created Lua at the moment is not able to create any specifics meta data keys that the application might want Which is pity, but it's some work in progress to be to have it Yeah, definitely a few more things that is not in top of my mind, but Otherwise it's quite cool. Yeah, actually there is also resource integration. So you can have it Quite well. I'll show some code But before showing the code just to showcase like how a plugin is initialized it on on Grillo So in this case is the video to talk our thing again I just need to create a table in this with the name source is important And set some some information from it for it ID the name and description They are all mandatory then you can say like this supported keys In this case like the name of the episode the show public date all this It can handle it can return some information for it if it's possible if he can do it The supported media is video. So yeah, something I did not mention before Grillo media has has some time ago for Since 2009 since it started three types of media actually for video image Audio and container and It's interesting for the for the plugin to filter it, right? I don't I don't want to like I don't know I want to give you lyrics information. I don't want to do it for images, right? So this is very handy in several cases So you can set like supported media for this this plugins do Yeah, reserve keys is the further reserve operations. It actually says like what is required So all it needs is a title like the file name in this case Let's show some sources some examples as well So far any questions, no So yeah, I open here two examples the garden videos and The Apple trailers, but why not let me open Totten first So this is the like my daughter Then channels you can see here So the Totten I open it Apple movies trailers is the one that I will show This is all done by these 100 lines in Lua Like getting this content right the feeling the widgets is part of the Totten Oh, don't know Yeah, Bastien was the one that wrote this one. Yeah, we can set some informations there In this case you saw that in Totten there is a icon related to GNOME to Guardian videos and is by this From the resource so it has integration with the resource is which is nice Yeah So you saw that I was able to browse actually I was able to browse Apple videos, but it's the same So what how it works with? API Lua API for implementing a function So in this case browse, right? If it was search the first parameter would be a text like what I want you to find as It is a browse. It's it's this media this media could be new as I said Then it should like provide the the root case for the browsing but if I like artists then it will be like the artist container, so It's like a parameter for the plugin to do the browse correctly in the right level Options are related to the grill options. So you can have like how many in this case these two cases how many How many that I want to return How many that I want to skip like I want to skip the first a hundred informations and videos or so and give me 50 more And yeah, this is like the code the logic behind it how to do the handling to get the right URL and Here is the one of the grillo functions grillo fetch Which does you can pass array or just a single URL and you can download the content of that So usually what happens is you are trying to get some JSON some XML Maybe HML and you want to parse it And this will provide you the content of it like So you pass the URL you want and the call do a callback function on some user data to it Callback function then the results are here could be more than one right and This is like one of the nicer functions one of them It like you don't have to Care about the content of the j-zone you you have a table now So you can like make the whole grillo media directly from it. It's actually it's actually what the law does the factory You need to pass back a grillo table and you Create a grillo media for you. So if I can have the j-zone in a in a table already Half a half of the work is done. Just a single line So just for example, this is the j-zone. You need like a response Statues and so on and in this case I did just one video and You so the results here array in j-zone provides like a type of a video Some other fields like let's see publication some summary and so on but in In the loo aside, they just need to like okay j-zone fail. No j-zone stats So I'm already accessing the j-zone. Is it fail? No, so if it fails you can like return it as I heard or you can like start to Walk through the table related to the results and returning each time doing a callback for the Misha media that you create then it will call the application callback and so on So quite quite fast. I have like five more minutes. I can show you another one with XML, which is Apple trailers But so far any other questions There's card. Yeah Yeah, so so in case of for example, for instance trying to fetch too much data Like downloading it and it can take time. So Yeah Yeah, so this this Grillo fetch is actually a user API for the Grillo Net which is a library for Grillo and this is like a leapsup implementation So what it does is like using leapsup is martyly to exactly handle this kind of information So Grillo has this library for the C plugins and we have it for the Lua plugins as well And it does it quite well It will not read maybe it will not return If I don't think there is any time out on the Grillo net, but it yeah, it could it could have some But yeah, I don't know if I never saw it, but it could be a bug. Yeah But so far it's not in the Lua side It would be in the library related to fetching the data right because this is all I'm Julie main loop and Yeah, and it just check if the data was already finished it or not and then keep doing other stuff Under scarf any other questions? Oh, so in case of Apple trailer is pretty similar browsing And fetching here as well It's basically that you like you have the input from the application you fetch some data you parse this data And you provide the in the callback the what it was requested So it's like very similar, but the main gains here compare with see is like these two functions the XML string to table and in the other case Guardian videos jzone string to table as well Right because it makes like from my string whole string that in see you have to parse each element And you can see like in the other sources like TV DB which I implemented It's very annoying like a hundred lines of just that and here's a hundred lines everything So very fast easy to write plugins nowadays with Lua so What I want to tell you in the end is that really is very cool For my opinion, it's a less very less code in your application Right because everything most of it is handled in and the application in the gorilla side One API to handle all the different technologies and protocols that have it that so you just need like one interface to for for all of them and Yeah, you can create three three types of plugins at least Yeah, if you want like Vala, which I know some people like See your Lua and so on That's all for me if you have any questions. Let me know You can find us in grillo and gip net.org Mao is there We have a good documentation which I did not show I Can show it now maybe yeah, so it's like really good documentation We have like how how to write applications with grillo how to do plugins with grillo how to implement sources Like it's very good documentation So all the operations are here Examples like all the descriptions. So if you my main goal is Making you understand how hard is it or how easy is it to have it and I hope you Understood them like it. That's all for me Can I throw I think it was just two scarfs, right? I think Okay, I don't know if I have a Can I remove it