Temporary freeze during publishing status - ofxTwitter, ofxOAuth

Hello!
I am using an app which is supposed to upload on my Twitter account a screengrab of the app.
The app works fine the only problem I have is that every time I upload the image, the video freezes for the time of the upload.
I thought it was the cout message that was taking resources so I disabled with ofSetLogLevel(OF_LOG_SILENT);
however I still got some message from ofxOAuth

CURLOPT_CAINFO: ../../../data/cacert.pem
IN MEMORY CALLBACK
ptr: 0x345876e4
size: 1
nmemb: 3562
data: 0xbfffc828
----
ptr: 0x345876e4
size: 1
nmemb: 3562
data: 0xbfffc828
realsize: 3562

I tried to mute them but there’s still some freezing time.
(It is definitely not the image grab and save that creates the lag)

Any idea anyone?

cheers

I don’t have much experience with ofxTwitter etc, but i suspect what is happening is that everything is happening on the same thread, so the rest of your program waits until the upload has done its thing.
I don’t know if that mirrors the behavior you’re seeing, but that would be my suspicion.

1 Like

@Miles thanks for replying.
I think your suspect might be the right answer.
I tried to put the tweet process in a separate thread with ofThread but it just wasn’t tweeting anymore and I haven’t figured it out why.
I will keep on looking into it.

thanks

There are some functions that have to run on the main thread, so that might be the case here.
I don’t know if it’s possible to run the video player on the other thread?
I haven’t used ofthread, so I’m just throwing ideas about here.

It might be worth (if you haven’t done this already) putting in some cout<< messages in ofxtwitter &/or ofxOauth to see how far it gets until it freezes.

Also what might be happening which is causing the pause is that ofxOAuth is authorising every tweet, rather than once when the app starts.

Allllso what’s it like sending an empty tweet rather than one with (I assume a screencap) data

Hth

There are some functions that have to run on the main thread, so that might be the case here.
I don’t know if it’s possible to run the video player on the other thread?
I haven’t used ofthread, so I’m just throwing ideas about here.

It might be worth (if you haven’t done this already) putting in some cout<< messages in ofxtwitter &/or ofxOauth to see how far it gets until it freezes.

Also what might be happening which is causing the pause is that ofxOAuth is authorising every tweet, rather than once when the app starts.

Allllso what’s it like sending an empty tweet rather than one with (I assume a screencap) data

Hi there!

I never worked with Twitter, but I did with Tumblr and e-mail attachments.

Usually, I would get a lot of issues with the add-ons. Because of time constrains, I decided to do system calls to run python scripts. For me, it was way simpler, less messy, OS threaded and well documented. Since then, I’ve never switched back.

Hope this is helpful.

@hubris @Miles thanks guys. nice feedback both of you I will try both ways and see what I’ll end up with!

cheers

Ahhhh cunning.
I normally work on iOS, so interesting to hear a simple alternative whilst on desktop

1 Like