Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Plugins/Viewers
| | |-+  Help with "plugin_load" function
« previous next »
  • Print
Pages: [1]

Author Topic: Help with "plugin_load" function  (Read 2964 times)

Offline jesteban100

  • Member
  • *
  • Posts: 6
Help with "plugin_load" function
« on: May 28, 2008, 12:14:39 PM »
Hi, I'm new on this, i know a little about C and assembler and now i'm tryng to read an mpg file from any plugin.
In the following link i've read about "plugin_load"

http://forums.rockbox.org/index.php?topic=13515.msg101863#msg101863

but i've got this error at cygwin:

"undefined reference to plugin_load"

Then i've tried

rb -> plugin_load(....)

and now the error is "the struct plugin_api has no member 'plugin_load"

i'm a little confused, and looking for help. How can i solve this problem?
Logged

Offline linuxstb

  • Developer
  • Member
  • *
  • Posts: 1163
Re: Help with "plugin_load" function
« Reply #1 on: May 28, 2008, 12:46:51 PM »
The plugin_load() function is used by core Rockbox to load a plugin.

Rockbox reserves a small amount of memory at a fixed address (512KB on most targets) to load a plugin to - all plugins are compiled and linked to run from this address, and you can therefore only run one plugin at a time.

So it doesn't make sense for plugins to be able to load other plugins - it's not possible.

What exactly are you trying to achieve?
Logged

Offline jesteban100

  • Member
  • *
  • Posts: 6
Re: Help with "plugin_load" function
« Reply #2 on: May 28, 2008, 01:00:54 PM »
i know that i can only read one plugin at the same time, but i've readed that "plugin_load()" loads another plugin and closes the first one. I'm not sure about that, but that's just what i've readed:

http://forums.rockbox.org/index.php?topic=15310.0
http://forums.rockbox.org...13515.msg101863#msg101863

I think that is correct to use "plugin_load()" cause this instruction is defined in plugin.h and plugin.c, but i can't find  how to use it properly, I really need help
Logged

Offline gratt

  • Member
  • *
  • Posts: 34
Re: Help with "plugin_load" function
« Reply #3 on: May 28, 2008, 02:00:37 PM »
You need to add plugin_load() into the plugin struct
in plugin.c/h to access it from a plugin.
I did this and was able to get the text viewer to open from
my HTML parser plugin but on exit was left with a blank screen
or data abort. I never got that sorted out.
Post back if you get it
GRaTT
Logged

Offline jesteban100

  • Member
  • *
  • Posts: 6
Re: Help with "plugin_load" function
« Reply #4 on: May 28, 2008, 02:57:47 PM »
Quote from: gratt on May 28, 2008, 02:00:37 PM
You need to add plugin_load() into the plugin struct
in plugin.c/h to access it from a plugin.
GRaTT

i've tried it but i get this warning:
warning: intialization from incompatible pointer type

and most of the plugins don't work properly in my sansa e250.

I`m afraid that i don`t know exactly how to add plugin_load() into the plugin struct
in plugin.c/h


what I exactly need is to load an mpg file from any plugin, i've tought in the "plugin_load" function, but if anyone know a different way...help me
« Last Edit: May 28, 2008, 04:16:22 PM by jesteban100 »
Logged

Offline GodEater

  • Member
  • *
  • Posts: 2829
Re: Help with "plugin_load" function
« Reply #5 on: May 29, 2008, 07:14:55 AM »
Quote from: jesteban100 on May 28, 2008, 02:57:47 PM
what I exactly need is to load an mpg file from any plugin, i've tought in the "plugin_load" function, but if anyone know a different way...help me

What exactly are you asking here?

If you wish to load a .mpg file from the plugin, then the plugin_load() function is not what you want at all.

If what you mean is you wish to launch the MpegPlayer Plugin though, then plugin_load() *is* what you're after.

Please clarify!
Logged

Read The Manual Please

Offline jesteban100

  • Member
  • *
  • Posts: 6
Re: Help with "plugin_load" function
« Reply #6 on: June 02, 2008, 04:49:56 AM »
I just wanna load a .mpg file from my plugin
Logged

Offline GodEater

  • Member
  • *
  • Posts: 2829
Re: Help with "plugin_load" function
« Reply #7 on: June 02, 2008, 05:21:12 AM »
I'm curious why though, what is your plugin going to do differently than MpegPlayer ?
Logged

Read The Manual Please

Offline jesteban100

  • Member
  • *
  • Posts: 6
Re: Help with "plugin_load" function
« Reply #8 on: June 02, 2008, 11:57:00 PM »
Quote from: gratt on May 28, 2008, 02:00:37 PM
You need to add plugin_load() into the plugin struct
in plugin.c/h to access it from a plugin.
GRaTT

I finally did it, thanks a lot, I’ve founded that the position of the new element of the api structure must to be the same in plugin.h and plugin.c
Sadly I can't load the mpg file: when I use the "plugin_load();" function it opens the plugin mpegviewer but immediately shows the error "Error opening file: -1". I don’t know why because if I start the mpg file from the Files menu it runs properly...

Dear GodEater, I’m happy to make you get curious  ;).
In my plugin I'm loading files .bmp with pictures of my last vacations. I have some videos and I want to load them selecting the picture. That is just to have fun.

I've seen that using 'plugin_load();' -maybe- isn't the solution, anybody has another idea??

Thx.
Logged

Offline GodEater

  • Member
  • *
  • Posts: 2829
Re: Help with "plugin_load" function
« Reply #9 on: June 03, 2008, 06:28:11 AM »
So in fact you're NOT doing what you said - you ARE trying to launch MpegPlayer from within your already running plugin.

This is not likely to be easy to acheive.
Logged

Read The Manual Please

Offline gratt

  • Member
  • *
  • Posts: 34
Re: Help with "plugin_load" function
« Reply #10 on: June 03, 2008, 12:48:03 PM »
Plugin load takes two arguments. The plugin and a file path or NULL.
I was able to get the viewer to open from my HTML parser with a text file. Closing was my problem.
I would supply some code but this was a long time ago and
I am out of town.
GRaTT
Logged

Offline LinusN

  • Member
  • *
  • Posts: 1914
Re: Help with "plugin_load" function
« Reply #11 on: June 04, 2008, 05:24:18 AM »
Loading a plugin from a plugin will not work, since the newly loaded plugin overwrites the previous one.

When the new plugin returns, the stack will be inconsistent and Rockbox will crash.

That's how Rockbox is designed, and it is not likely to change. Sorry.
Logged
Archos Jukebox 6000, Recorder, FM Recorder/iAudio X5/iriver H1x0, H3x0/Toshiba Gigabeat F20/iPod G5, G5.5

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Plugins/Viewers
| | |-+  Help with "plugin_load" function
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.093 seconds with 14 queries.