Jump to content

Renate Schaaf

  • Content Count

  • Joined

  • Last visited

Community Reputation

9 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Renate Schaaf

    Project Bitmaps2Video on GitHub

    This is my video-project on GitHub: https://github.com/rmesch/Bitmaps2Video I am presenting it here, because it is useful as it is, but could use some ideas for improvement. Features: A Delphi-class to support encoding of a series of bitmaps and video clips to a video file Requires the ffmpeg-library and is intended as an easy to use interface to this library Versions for Win32/Win64 and a cross-platform version currently supporting Win32/Win64/Android32/Android64 Most popular file formats and codecs supported, more codecs contained in FFMpeg can be registered Rudimentary support for adding an audio-stream Demos for both versions, set up to compile and run "out of the box", as library files and support for their deployment to Android are included There are some problem areas though, the most important one in my opinion being threading issues with TBitmap under Android. For more see the readme and the demos. Critique, ideas, bug reports most welcome, maybe someone would even like to contribute, that would be delightful. There have been valuable contributions so far, but there are some areas which could use the input of an expert. Thanks for reading, Renate
  2. Just bought it for those sleepless nights, Thanks!! Renate
  3. Renate Schaaf

    Browsing for certain files on Android

    Please excuse my lack of knowledge here, I'm just starting to work with this Android stuff. I guess so. Well, I think I know how to do this, but that wouldn't help the user to pick to right video file, I need the thumbnails. By browers I mean that every app that processes the file type gets displayed at the top of the window that opens. For example Google fotos, Samsung gallery, ... I just want to open the documents folder ("Eigene Dateien" in my German tablet).
  4. Renate Schaaf

    Browsing for certain files on Android

    All I want is a substitute for an OpenFileDialog on Android, I mean, that can't be so hard, I thought. In particular I want the user to pick a video file and read its file name. I found this https://delphi-developers-archive.blogspot.com/2017/05/delphi-android-get-file-path-of-image.html and modified it a bit, so it either returns a valid file name or else fails: procedure TForm1.BrowseForVideoFile; var Data: Jnet_Uri; Intent: JIntent; begin // fMessageSubscriptionID: integer is a field of TForm1 FMessageSubscriptionID := TMessageManager.DefaultManager.SubscribeToMessage (TMessageResultNotification, HandleActivityMessage); Intent := TJIntent.Create; Intent.setType(StringToJString('video/*')); Intent.setAction(TJIntent.JavaClass.ACTION_GET_CONTENT); MainActivity.startActivityForResult(Intent, 0); end; // when message is received procedure TForm1.HandleActivityMessage(const Sender: TObject; const M: TMessage); begin if M is TMessageResultNotification then if HandleIntentAction(TMessageReceivedNotification(M).Value) then begin // A valid filename has been returned // Do The Videofile processing end; Edit2.text := fVideoFilename; end; // This retrieves the file name the user picked, but reliably only if done per // opening MyDocuments function TForm1.HandleIntentAction(const Data: JIntent): Boolean; var P: TJavaObjectArray<Jstring>; // in case you want only specific fields... not used here. I have passed nil to get all the columns. C: JCursor; I: integer; begin P := nil; // The following makes no difference // P:=TJavaObjectArray<Jstring>.create(1); // P.Items[0]:=StringToJstring('_data'); // this is suppose to give the information back to C ( : JCursor) C := MainActivity.getContentResolver.query(Data.getData, nil, // when projection is nil... it returns all columns. Ideally, you should only ask for the columns you need StringToJString(''), // java accepts nil... but you cannot give nil here, you need to give an empty JString nil, StringToJString('')); // java accepts nil... but you cannot give nil here, you need to give an empty JString C.moveToFirst; Result := false; for I := 0 to C.getColumnCount - 1 do begin if JStringToString(C.getColumnName(I)) = '_data' then // '_data' column contains the path... you can use this to create the filestream to upload or do whatever.... begin // fVideoFilename is a field of the form fVideoFilename := JStringToString(C.getString(I)); Result := true; Break; end; end; if not Result then fVideoFilename := ''; // P.Free; end; My problem is, that this offers way too many browsers for the user to choose from, when all that really works is browsing MyDocuments. What is the right approach to limit the browsers to MyDocuments? Or is there an easier way to begin with? Thanks for reading, Renate
  5. That's my limited impression after a break of 12 years from Delphi. I paid for all versions up to 2006, now I'm using the community edition, and I am grateful for having the chance this way to come up to par with the new stuff, so I'm a bit reluctant to bash them. I answered here because of general interest in component design, not because I'm particularly interested in this component. This looks good, I have it tagged.
  6. I didn't dare to say that, but that's what I thought:) Now I wonder whether there is a way to make this safe short of changing the source code or writing a wrapper component with a TNetHTTPClient as a subcomponent and exposing its things as needed, which seems to be a lot of work.
  7. I'm a bit puzzled here, because usually it is a big no-no to assign code to a published event in a descendant component. Because the event is still published and anybody using your component can assign something else to this event and your added functionality is gone. Usually you should override the method which calls the event, add the functionality and call inherited. Only: Looking at the source code I see that this method (DoReceiveData) is both private and not virtual, so there's no chance to do it this way. I wonder whether there's a reason the Delphi developers did it that way, or why have they abandoned the usual component design patterns? Anyway, I would at least unpublish these events, along the lines in https://stackoverflow.com/questions/53677049/hide-properties-and-events-in-new-component